Tagged Questions
Fragments represent reusable behaviors or portions of user interface in an Android app.
0
votes
3answers
16 views
Call a method when fragment is visible to user
I need execute a method when the fragment is visible (to the user).
Example:
I have 2 buttons (button 1 and button 2) ,
2 fragments(fragment 1 and fragment 2)
and the method loadImages() inside the ...
0
votes
0answers
6 views
Android re-showing dialogfragment from separate fragment
I have an application that is using fragments. The set up is like so:
Main Activity loads, loads fragment activity into right portion of parent activity
-From the Fragment, I launch a DialogFragment ...
0
votes
1answer
6 views
Android, next fragment when listitem is clicked within one tab
I have made an android application with a tab bar / action bar (3 tabs).
My app is based on this tutorial: http://www.androidhive.info/2013/10/android-tab-layout-with-swipeable-views-1/
this is how ...
0
votes
0answers
11 views
Prevent clicks from going to the fragment beneath?
I have just one Activity in my app that hosts fragments that are dynamically changed using a transaction. At the start the user is required to select a show and on click a new fragment is loaded which ...
0
votes
1answer
9 views
Android: How to recreate (or refresh) the gridview in a fragment
I am building a gallery like application. It consists of a grid view showing the thumbnail of the photos and a button to take a new picture. To get the thumbnails of the images on the phone, I used an ...
0
votes
0answers
8 views
Activity member fragment and viewpager, calling fragment method?
I just want to call sayHello() from mFragmentA inside onStart() method. how can I do it.
I do not want to use sparceArray inside my viewpager adapter and keep track of fragments.
I paste all codes but ...
1
vote
2answers
16 views
Sharing data between android fragments
I have two fragments.
The checkNodesFragment creates dynamically an ArrayList of checkBoxes and then
the ReserveNodesFragment should access which of them were checked in checkNodesFragment.
What ...
0
votes
0answers
12 views
Dynamic android layout background
I have this Fragment with ListView.
How to set the background to be the same as in the image uploaded in ImageView, so that I can fill dynamically every row with the same background of the image that ...
-4
votes
3answers
42 views
Show two Activities inside a an Activity
I have two different Activities, and I want to show them both at the same time in another Activity. Is there any way to do that?
Thanks in advance!
0
votes
1answer
10 views
Android runtime generated tabs and content
I am creating an application on Android which is essentially an interactive menu. I will have several categories for this menu, with a list of items in each. These items and item groups are specified ...
1
vote
1answer
17 views
ViewPager with FragmentPagerAdapter as a fragment itself?
is it possible for a View Pager with FragmentPagerAdapter to be its own fragment and not a fragment activity?
Here is a picture of what I mean.
...
0
votes
0answers
26 views
sendBroadcast does not get called in Activity when Activity is opened
Hi all I am making an app where I receive XMPP packets. My app starts in foreground and starts a Sticky Service if not started and start receive messages in backgrounds and make notifications of them. ...
0
votes
2answers
19 views
Adding Action Bar and Navigation Drawer together without actionbar sherlock
I have already implemented navigation drawer in my app and I want to add swipe Tabs also in my activity. Is it possible to add both these functions in a single activity ? How ?
I have searched many ...
0
votes
1answer
12 views
onNewIntenet not in SherlockFragment so clicking on notification while on Fragment does not change the view
Hi all I am in a difficulty now where I am not able to decide where to go to. I have a app where I receive XMPP packets in a service in background and from there either I make notification. Those ...
0
votes
1answer
14 views
Global, dynamic checkboxes android
I have a ReserveNodesFragment where i create dynamically checkBoxes.
I have declared the orbitCheckBoxes globally, since another fragment should access them, too.
I have declared the checkBoxes ...
0
votes
0answers
9 views
viewpager and datepciker/ fragment manager
I can not extend ViewPagerAdapter to any other class !! help
I need to implement the datepicker inside this class.When I implemented it in the main activity the date changes only in the first view ...
0
votes
1answer
22 views
committing a fragmentTransaction in onResume. Smart way to solve this?
I have a Fragment that calls an asynchronous task, and when the result returns, commits a fragmentTransaction.
However, this sometimes returns an illegalState exception due to the OS calling the ...
0
votes
1answer
8 views
Regarding implementation of android internationalization
hiii
I have to create an android app where we can implement internationalization?for an example suppose there is an app where we can login and move to the next page.I want to change the the language ...
-1
votes
1answer
17 views
How to get Current Fragment class instance from Activity?
Activity1 placed with fragment and starting activity2 by action item after closing activity2 i need to get a fragment instance of current fragment placed in activity1? thanks in advance
0
votes
2answers
22 views
in fragment startActivityForResult does not call and it closes it sleft Android
I know there is so many question related to this but I still not find any solution i have tried all the things.
from onActivityResult() not called when Activity started from Fragment I find
...
-1
votes
0answers
8 views
Fragment opening behind the MapView
I am opening a Fragment over my MapView via using following code:
FragmentManager fragmentManager = getSupportFragmentManager();
FragmentTransaction ...
0
votes
1answer
22 views
Creating fragments programatically android Xamarin
I am creating fragment in android Xamarin.
This is what I have done so far:-
PortfolioFragment.cs
class PortfolioFragment: Fragment
{
public override View OnCreateView(LayoutInflater inflater, ...
-1
votes
2answers
46 views
onBackPressed() in Fragment in Android
I am looking for onBackPressed() event in Fragment (not activity) in Android.
I am using AsyncTask() on one Fragment. And I want that If user Press Back Button then It finish that Fragment and go on ...
0
votes
2answers
27 views
How to reuse fragment's view in Android?
I am creating a Fragment Activity with tabs. Now whenever i select a tab, corresponding fragment gets recreated and its
onCreateView()
method is called.
But what i want is to reuse the view of the ...
0
votes
4answers
25 views
startActivity(intent) shows an error when calling a number in Fragment upon Button click
I need to call a number upon clicking an ImageButton in my custom ListView in my Fragment. I have given
Intent intent = new Intent(Intent.ACTION_CALL);
intent.setData(Uri.parse("tel:" ...
1
vote
1answer
17 views
Please help clarify the current standards for Settings activities in Android
I'm new to android and am working on my first app. I tried to add a settings activity and Eclipse loaded a bare-bones class that utilized deprecated functions like addPreferencesFromResource. I looked ...
0
votes
1answer
23 views
Start fragment in landscape mode
Thanks in advance for your help.
I'm trying to load one of my fragments which is loaded from a drawerlayout activity in landscape mode by invoking
...
0
votes
2answers
16 views
Change background color of a specific tab in android tabs swipe
This is my onCreate of my main activity
private ViewPager viewPager;
private TabsPagerAdapter mAdapter;
private ActionBar actionBar;
private TabHost tabHost;
// Tab titles
private ...
0
votes
0answers
24 views
Android: Nothing show up after inflate with layout in fragment
I use fragments in my application and I have tried various of ways but I am not able to inflate new layout to my main page.
No error is reported onCreateView
MainActivity.java
public void ...
0
votes
1answer
15 views
ViewPager blank on back from another fragment
Actually I am using whole application in a single activity by fragments in main view container.
One fragment contain a viewPager when i clicked over an header button frgment replace by LoginFragment ...
0
votes
0answers
4 views
Android overlay scrollview by programatically adding a fragment on top
Im making a layout in which i have a "header", and below it a scrollview. Below the header, i want to add another fragment that should be drawn on top (i.e. overlay) the scrollview. I currently have ...
0
votes
1answer
20 views
Android tabs not switching correctly
So I have some simple code inside the getItem method of the FragmentPagerAdapter Class:
@Override
public Fragment getItem(int i) {
switch (i) {
case 0:{
return new ...
0
votes
1answer
31 views
Creating custom list view in android using arraylist items
I would like to know how to create custom list view in android for my app. My app has a navigation drawer in it which contains several fragments. In one fragment I have to show a custom list view ...
1
vote
2answers
42 views
How to add a listview item to a whole other listview
So in my android app, I have two scrollable tabs which each contain Listview using a Fragment. One a list of apps and the other is blank. What I am aiming to do is add a plus button in place of where ...
0
votes
0answers
9 views
Action bar tabs fill width
I'm implementing android tabs in the actionbar but seems when displaying the screen on tablet i have a weird issue.
The tabs look like this:
Does anyone knows a fix or a workaround so the tabs can ...
0
votes
0answers
22 views
Error while attaching fragments
I am trying to replace a fragment with the same fragment and getting this error.
07-30 21:44:36.062: E/AndroidRuntime(25254): FATAL EXCEPTION: main
07-30 21:44:36.062: E/AndroidRuntime(25254): ...
0
votes
0answers
19 views
Align Fragment LinearLayout on bottom of screen
I'm trying to align a fragment at bottom of screen using gravity bottom but this doesn't work for me. Fragment code is as follows:
<!-- Text field and possibly soft menu button above the keypad ...
0
votes
1answer
20 views
Android Xml Pull Parser error - SitesDownloadTask.onPostExecute
I have different three Adapters and three XML Parsers in my application for three Fragments sliding on ViewPager.
My application works fine until I start sliding a little faster between first and ...
-1
votes
0answers
5 views
ActionBarSherlock Side Menu Navigation with Nested ViewPager Fragment Tabs, Problems with ActionBarSherlock
So i'm trying to implement this into my app:
http://www.androidbegin.com/tutorial/actionbarsherlock-side-menu-navigation-nested-viewpager-fragment-tabs-tutorial/
Where one of the selections in the ...
0
votes
0answers
10 views
WebView in Fragment in ActionBar-navigated Activity - how to avoid reload?
So I have an activty with 3 tabs which I navigate between through the ActionBar (SupportActionBar). Each of the tabs has a Fragment with a WebView attached to them, with a TabListener implement as ...
1
vote
2answers
17 views
Static fragment over ViewPager
I'm trying to develope a Walkthroughs that looks like skillpages app, but I don't know how to put a static fragment with buttons a ViewPager creating the filling of button flotating over the image, ...
0
votes
1answer
17 views
Close Navigation Drawer on application start
I have developed an application with Navigation Drawer. Whenever the application starts for the first time, it has navigation drawer open.
Is there any way I can set it as closed? Below is the auto ...
0
votes
0answers
11 views
TabHost not loading properly on ViewPager
Using a ViewPager, I am trying to load tabs into them.The first page on the ViewPager loads correctly. The tab's have their contents loaded and we can toggle between tabs. But when we swipe onto ...
0
votes
1answer
20 views
.getSupportActionBar not available in Fragment; workaround leads to NullPointerException on rotation
Structure
(names of Activies/Fragments changed)
Based on some advice written in Android Programming: The Big Nerd Ranch Guide, I have the following structure:
MyListFragment extends ListFragment
...
-1
votes
1answer
13 views
How action bar behave on FragmentTransaction replace() and FragmentTransaction add()
I am using fragment, to display two screen in my application.
Each Fragment has its own set of menu layout for action bar buttons .
On commit for a fragment using FragmentTransaction replace() ...
-2
votes
0answers
17 views
Fragment on top, not under the activity
in my app I have a clickable textview, when I click on it I want to show a fragment.
I succeed to do it but the fragment is shown UNDER the layout of the activity, I want it on TOP.
Using ...
-1
votes
2answers
24 views
Fragments get loaded every time i switch tab, need efficient method
These are the screenshots of my application,
http://i.stack.imgur.com/3GYAc.png ==> after loading the list from remote server the list is populated.
The problem for me is this,
When i move to the ...
-1
votes
0answers
5 views
how to hide and unhide install apps in android
i am new in android.i have List View which contain all phone install application.when i click on particular application then it hide from the phone but when i unhide apps then occur error like as:
...
1
vote
0answers
11 views
Dublicate fragment allocation when using ViewPager with different layouts
I've observed very strange Android fragment allocation behaviour in my application recenty.
My application has two fragments and two layouts:
portrait layout with ViewPager as root view;
landscape ...
0
votes
1answer
21 views
Fragments extends ListFragment but method getItem() has return type of Fragment
Fragments TopRatedFragment,GamesFragment and MoviesFragment extends ListFragment but method getItem has return type Fragment.If I change the return type to ListFragment it shows error as it is the ...