Android Error : "must implement onFragmentInteractionListener"
I am building a new note pad app. I was trying to connect each fragment into the main activity. But I got an error,"must implement onFragmentInteractionListener".
I found the problem is I have to implement onFragmentInteractionListener in each fragment. e.g.
public class MainActivity extends Activity
implements NavigationDrawerFragment.NavigationDrawerCallbacks
Inside the class:
Code
public void onNoteFragmentInteraction(String string){ | |
NoteDetailFragment fragment=NoteDetailFragment.newInstance("",""); | |
| |
| |
| |
// update the main content by replacing fragments | |
FragmentManager fragmentManager = getFragmentManager(); | |
fragmentManager.beginTransaction() | |
.replace(R.id.container, fragment ) | |
.commit(); | |
| |
} |
Trackback address for this post
Trackback URL (right click and copy shortcut/link location)
Feedback awaiting moderation
This post has 4678 feedbacks awaiting moderation...
Form is loading...