Related questions
findViewById in Fragment
I am trying to create an ImageView in a Fragment which will refer to the ImageView element which I have created in the XML for the Fragment. However, the findViewById method only works if I extend an Activity class. Is …
Android Fragment handle back button press
I have some fragments in my activity
[1], [2], [3], [4], [5], [6]
And on Back Button Press I must to return from [2] to [1] if current active fragment is [2], or do nothing otherwise.
What is the best practise to do that?
EDIT: Application must not return …
Using context in a fragment
How can I get the context in a fragment?
I need to use my database whose constructor takes in the context, but getApplicationContext() and FragmentClass.this don't work so what can I do?
Database constructor
public Database(Context ctx)
{
this.…