Kunu
Kunu

Reputation: 5134

Error in getSupportFragmentManager

Why I am getting an error message showing change getSupportFragmentManager() to getFragmentManager()

googleMap = ((SupportMapFragment) getSupportFragmentManager().findFragmentById(R.id.map)).getMap();

Upvotes: 0

Views: 3052

Answers (2)

user2860053
user2860053

Reputation:

Here FragmentActivity docs:

http://grepcode.com/file/repository.grepcode.com/java/ext/com.google.android/android/4.0.1_r1/android/support/v4/app/FragmentActivity.java

You issue is MainActivity is not extending FragmentActivity and SupportPackage an Activity must inherit from FragmentActivity to get Methods like getSupportedFragmentManager().Activity is inheriting from another class, you implement one of classes and kind of merge them.

May be possible answer here

The method 'getSupportFragmentManager()' is unsuported

Upvotes: 2

Zymurgeek
Zymurgeek

Reputation: 169

MainActivity must extend FragmentActivity

Upvotes: 1

Related Questions