android-fragmentactivity

Get EditText value on different fragment

笑着哭i 提交于 2019-12-02 02:33:08
问题 I am trying to get some text from editTexts on different fragments. So what I do first is define my mPager and mPagerAdapter : a_Atenuacion Activity public class a_Atenuacion extends FragmentActivity{ private static final int NUM_PAGES = 3; /** * The pager widget, which handles animation and allows swiping horizontally to access previous * and next wizard steps. */ private ViewPager mPager; /** * The pager adapter, which provides the pages to the view pager widget. */ private PagerAdapter

How to start Fragment from Activity?

纵饮孤独 提交于 2019-12-01 18:12:27
I have one Fragment: ProductsFragments extends Fragment and one Activity AdminMenuActivity extends ActionBarActivity I want to call ProductsFragments from AdminMenuActivity. I have used 2 options: 1) FragmentManager fm = getSupportFragmentManager(); for(int i = 0; i < fm.getBackStackEntryCount(); ++i) { fm.popBackStack(); } FragmentTransaction tx = getSupportFragmentManager().beginTransaction(); tx.replace(R.id.frame_layout, android.support.v4.app.Fragment.instantiate(AdminMenuActivity.this, fragments[1])); tx.commit(); 2) Intent intent1 = new Intent(AdminMenuActivity.this, ProductsActivity

How fix this: on logcat -->> error loading /system/media/audio/ui/Effect_Tick.ogg??

混江龙づ霸主 提交于 2019-12-01 17:03:50
I have a problem: error loading /system/media/audio/ui/Effect_Tick.ogg It's shown when I click navdraw icon. Anybody can help me?? This is errors on logcat: 04-20 01:42:11.240: E/SoundPool(639): error loading /system/media/audio/ui/Effect_Tick.ogg 04-20 01:42:11.251: E/SoundPool(639): error loading /system/media/audio/ui/Effect_Tick.ogg 04-20 01:42:11.251: E/SoundPool(639): error loading /system/media/audio/ui/Effect_Tick.ogg 04-20 01:42:11.280: E/SoundPool(639): error loading /system/media/audio/ui/Effect_Tick.ogg 04-20 01:42:11.280: E/SoundPool(639): error loading /system/media/audio/ui

Fragments restore state on orientation changed

无人久伴 提交于 2019-12-01 15:10:28
问题 I have to implement "standart" fragments navigation in my app (please see link). The issue is when device is in portrait mode, there should be shown only 1 fragment, and when it is rotated to landscape mode, 2 fragments should be shown. I tried to do this 2 different ways: 1) I use only 1 activity with different portrait and landscape layouts. Portrait layout xml: <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android

Saving MapFragment (Maps v2) State in Android

你。 提交于 2019-12-01 15:02:14
I'm working with the new GoogleMaps API (v2) and have some problems with the fragment. I have two fragments in my app (Map, List) and the user can switch between them. Works fine so far with this code: if (itemPosition == 0) { getSupportFragmentManager().beginTransaction() .replace(R.id.fragmentpos, myMapFragment).commit(); } else if (itemPosition == 1) { getSupportFragmentManager().beginTransaction() .replace(R.id.fragmentpos, myListFragment).commit(); }...... When I work with the map, switch to the list fragment and then back to the map fragment, the last position of the map is not saved.

How to set application fragments to portrait mode only?

放肆的年华 提交于 2019-12-01 10:47:55
I have an Android app which has a main activity and 3 Fragments which are tabs. I would like the application to remain in portrait mode at all times but I can't seem to get this working. This is what I have tried, as per another stack overflow post, but I'm not sure what I'm doing wrong....does it need to be different if using fragments? <activity android:name="com.tutorial.test.activities.act1" android:label="@string/app_name" android:screenOrientation="portrait" android:configChanges="orientation|keyboardHidden" > <intent-filter> <action android:name="android.intent.action.MAIN" /> <category

Android Activity Flow (Login or Register and go to Home)

时光总嘲笑我的痴心妄想 提交于 2019-12-01 08:44:59
I am building an application which requires user authentication. First time a user opens the app should login or register to continue to the home screen of the app which loads some posts.. i should mention that the home screen should be a FragmentActivity to allow user navigate between 2-3 tabs.. this means that i should have another Activity (for the login screen or register) to allow the user to continue later to home. MainActivity | | --> Check If user logged in | | | | | --> Start Login Activity (Or Register From Here) | --> Start Home Activity (FragmentActivity with 2-3 tabs-fragments)

Passing parameters from Android FragmentActivity to Fragment

白昼怎懂夜的黑 提交于 2019-12-01 06:44:01
When Im trying to pass a parameter from FragmentActivity to a Fragment it gives me null pointer exception in the getArguments() in the Fragment. Here is my FragmentActivity Code public class IndexChartActivity extends FragmentActivity { @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.index_chart); IndexFragmentActivity indexFragment = (IndexFragmentActivity)getSupportFragmentManager().findFragmentById(R.id.index_fragment); indexFragment.newInstance("ASPI"); } } Here is the index_chart.xml <?xml version="1.0" encoding="utf

FragmentActivity with ViewPager: Crash on orientation change

南楼画角 提交于 2019-12-01 05:24:29
Hi guys I have used ViewPager in FragmentActivity. I am getting a crash when orientation changes. @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_list); context = this; loadInitialData(); setActionBar(); initializeUiComponents(); } private void initializeUiComponents() { // Set up the ViewPager with the sections adapter. mViewPager = (ViewPager) findViewById(R.id.pager); } My data is coming dynamically from the database, and I have to call the Sysnctask which is getting the datat from database in onResume().

FragmentActivity with ViewPager: Crash on orientation change

爷,独闯天下 提交于 2019-12-01 02:32:56
问题 Hi guys I have used ViewPager in FragmentActivity. I am getting a crash when orientation changes. @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_list); context = this; loadInitialData(); setActionBar(); initializeUiComponents(); } private void initializeUiComponents() { // Set up the ViewPager with the sections adapter. mViewPager = (ViewPager) findViewById(R.id.pager); } My data is coming dynamically from