I am using the navigation-drawer template in eclipse to do a simple Android application. I have some trouble with fragment. I declared a fragment called PresenceLog Fragment in manifest but when I called it in MainActivity, the log still says that Here is my manifest Here is my fragment class Here is my MainActivity It would be great if you
Tag: android-fragments
Fragments inside LinearLayout – Android
I’m new with fragments and I try to use these. My xml from activity is: And I want to change the fragment inside of LinearLayout, my class of mainActivity is: And my PlaceHolderFunctions are: Why doesn’t work when I press the button? What do I doing bad? Srry for my english and thanks in advance! PD: If you need more
Hide keyboard when navigating from a fragment to another
I have a Fragment that contains an Edit Text. When the Edit Text is pressed, the keyboard is being shown. When pressed the Save button in the upper corner, the application returns to the previous fragment, but the keyboard persists. I would like the keyboard to be hidden when navigating to the previous fragment. Please, note that I tried this
How to load image from URL in Fragment class?
I want to load an image from its URL in Fragment class. I’m loading the image like this: but this method is taking more time to load the image and to open it. If I want to use ImageLoader class like this tutorial, then how to load it in Fragment? Answer Use any 3rd party library like Picasso. Download the
How can I change option menu in different fragments?
I have a Fragment with menu: I would like to change menu but it doesn’t work and keep the old action menu Fragment B is equals like above with different inflate XML menu. EDITED: Can be useful to use different menu layout for different fragments and 1 menu layout for main activity and differents id Answer Put setHasOptionsMenu(true) in constructor
How to change fragments using Android navigation drawer
I know these types of question have already been here but still I have not found my answer for this question: I have created an application and used navigation drawer that has been created AUTOMATICALLY by the app (AndroidStudio) Here’s what I have: And some more here: I want to display another fragment using the button in navigation drawer. I
Retrieve Context from a fragment
I created a class to retrieve comments from a JSON encoding from a PHP file. This class, extends from AsyncTask: As you can see, I’m trying to show a ProgressDialog while the “doInBackground” proccess is working. But progressDialog constructor, asks for a Context, and I don’t know how to provide it. I’m calling this class from a Fragment, so I
How to hide the soft keyboard inside a fragment?
I have a FragmentActivity using a ViewPager to serve several fragments. Each is a ListFragment with the following layout: When starting the activity, the soft keyboard shows. To remedy this, I did the following inside the fragment: I save the incoming ViewGroup container parameter from onCreateView as a way to access the window token for the main activity. This runs