android-fragmentactivity

Fragment was unable to replace with fragment in viewpager

非 Y 不嫁゛ 提交于 2019-12-13 05:04:25
问题 I'm working with fragments with ViewPager concept. I'm creating a diary app in which I'm using only one fragment which gets all updates from database and show in it. Until this everything is fine...According to my requirement when i click on a button in fragment i need to show another fragment which allows the user to store the images. My problem is..... --If i use replace method in fragments it was not replacing properly in the sense if A is fragment which consists of viewpager and B is a

Creating an Android app using tutorial does not show a fragment layout field

▼魔方 西西 提交于 2019-12-13 05:02:07
问题 I am a newbie. I am trying to learn android. I am using android tutorials to build first app. I Go to New>Android Application Project . Then I insert application name as "My First App". Then a few Next,Next, using default values. On the create activity window, I select the Blank activity and click next. Now the problem arises. On the next screen it shows only three fields: 1) Activity name 2) Layout name 3) Navigation type The problem is that it does not show the 'Fragment layout name' field.

Android Fragment - Application Crashed after Closing Application

柔情痞子 提交于 2019-12-13 04:23:48
问题 In my application I am using google map in fragment . I am using this code for adding fragment s. public void addPage(final BaseFragment pBaseFragment, final boolean isAddToBackStack){ FragmentTransaction transaction = mFragmentManager.beginTransaction(); transaction.add(R.id.content_frame, pBaseFragment); if (isAddToBackStack) transaction.addToBackStack(null); transaction.commit(); } In MyMapFragment I call this for removing map (If I don't do this I got duplicate id for map exception)

Results from a DialogFragment to an ActivityFragment

只愿长相守 提交于 2019-12-13 04:17:27
问题 I have a DialogFragment , that depending on how it's called, will either pop up a dialog, or start an Intent, based off of results from the dialogFragment . Essentially, my DialogFragment is a list of activities, which depending on how I call I will want more information about the activity, or to start the activity. Ideally, I would like to have something akin to the onActivityResult to handle these results, in my base class. Doing some research has indicated that if I was using a Fragment,

App crashing when using fragments

人盡茶涼 提交于 2019-12-12 10:47:06
问题 Im working with fragments and.. Ive got a problem in my code that I just cant find. The logcat points at this piece of code, in one of my fragments: @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { return inflater.inflate(R.layout.activity_main, container, false); } My main class (the FragmentActivity): import android.app.Activity; import android.os.Bundle; import android.support.v4.app.Fragment; import android.support.v4.app

Content of ViewPager disapear after changing fragments

a 夏天 提交于 2019-12-12 05:57:58
问题 i'm back here with a new Question. So at the moment i created an app , that can switch from a fragment to another fragment when you click on a button. And inside those 2 fragments there is 2 viewPagers, whose create a custom number of buttons. But the problem is that when i switch from a fragment to the other one, and then i switch back , the content of the first one is no longer here. I tried a lot of things and nothing really help me. And i hope you can help me. Thanks in advance. The Main

Example of how to use MvxCachingFragmentActivity

耗尽温柔 提交于 2019-12-12 02:15:35
问题 Update - Thanks to @Martijn00 and @Plac3Hold3r I have managed to update my app to use the MvxCachingFragmentCompatActivity but it is just not working correctly. I am finding that if I go back sometimes the the ViewModel will be available, but the commands in the view model will be null. Also if I go back and then forward, some of the buttons don't respond. I assume this is the same issue. What I really need to know is what the additional functionality the caching activity gives me, and how to

Linking from an activity to a fragment activity with a button using actionBarSherlock

大城市里の小女人 提交于 2019-12-12 02:15:27
问题 I made a project wherein when you click a button from the MainActivity, it will lead to a fragment activity. But I can't seem to make it work. Here's a snippet of my code for the button in MainActivity: Button button2 = (Button) findViewById(R.id.button2); button2.setOnClickListener(new OnClickListener () { public void onClick(View v) { Intent intent = new Intent (v.getContext(), page3.class); startActivityForResult(intent, 0); } }) ; Here's my snippet for page3 where the button from

How to open two webviews in one screen using fragments

泄露秘密 提交于 2019-12-11 12:34:51
问题 could any one help me in figuring out how to open two webviews in the same screen using fragments Android,each webview must display a certain web page for example :1-google,2,yahoo. i've tried too many tutorials and samples .nothing works fine for me... :( The main issue for me that conflicting my thoughts, is what to write in the fragment class to open a webView and what to write in the main activity that runs the whole app . Thanks in advance for any help.. :) here is my code that runs fine

on option item selected want to execute the fragment method?

点点圈 提交于 2019-12-11 11:52:05
问题 i have a tab activity with four fragments.each fragments have their own interface.now i want to execute one of the fragment method by onOptionItemSelected method of the option menu.what should i do? below is my complete code. TabedActivity public class TabedActivity extends ActionBarActivity implements Tab1.TabedInterface { // Declaring Your View and Variables private String myString = "hello"; //for getting data from fragment// String contact; String address; String datOfBirth; ViewPager