fragment

Android Changing a Normal Layout to Tab Layout error in Image buttons and other?

筅森魡賤 提交于 2019-12-23 09:46:46
问题 I followed this to create an Android Radio Stream over there It's working fine So I am trying to add a tab-layout to this So I followed this to add Tab layout Over there I have Added But I got Lot of error so I have Changed some like FROM protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main_activity); TO this @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View

Android TalkBack and fragment stack

ぃ、小莉子 提交于 2019-12-23 09:43:55
问题 For an application that I work on, I need to implement accessibility. Everything works fine except for one screen where I have to fragments added to my activity. Basically, the fragment that is above is a dial keyboard to enter a passcode. This fragment is added with a fragmentTransaction. The thing is that the talkback focus is set on the elements of the underneath fragment. Do you know if there is a way to set the talkback focus on the dial fragment ? I just want to "disable" the fragment

Check if a fragment exists and reuse it

*爱你&永不变心* 提交于 2019-12-23 09:26:43
问题 I'm using the following code to create a fragment everytime the user click on an item in a list view. But in this way the fragment is created at every user click. What I want is to reuse the old fragment (if it exists) and only reload its content (don't create a new one). MagazineViewFragment fragment = new MagazineViewFragment(); fragment.openStream(itemSelected); FragmentManager fragmentManager = getFragmentManager(); fragmentManager.beginTransaction() .replace(R.id.container, fragment)

Stuck with porting from activity to fragment

喜你入骨 提交于 2019-12-23 09:07:36
问题 It's now one week exactly that I try to port a simple activity-based app to fragments. I'm totally stuck. This beast is a simple List, Details, Add/Edit app with contextmenu and optionmenus. I tried to make it right: Fragments and activities each in their own file, using the v4 support-package for phone and tablet, fragments do everything a re-usable fragment should do and callbacks (lots of them) fly around to inform activities and fragments about what to do. Converting from SQLiteOpenHelper

Get value from Bottom Sheet Dialog Fragment

夙愿已清 提交于 2019-12-23 07:40:51
问题 I'm starting bottomSheetDialogFragment from a fragment A. I want to select the date from that bottomSheetDialogFragment then set it in the fragment A. The select date is already done, I just want to get it in the fragment A to set it in some fields. How can I get the value? Any suggestions how to do it? 回答1: Create an interface class like this public interface CustomInterface { public void callbackMethod(String date); } Implement this interface in your Activity or Fragment . and make an

change fragment(?) layout or activity using a navigation drawer

断了今生、忘了曾经 提交于 2019-12-23 07:29:10
问题 I'm trying to use the new Navigation Drawer . I followed the guideline and I managed to have it working with section names title changing on item selected and so on. Now I'm stuck because I have no idea how to archive what I want to do next. When I click on an item in the drawer - home , for example -I want it to bring me to a screen where I have all the stuff I created in a particular layout for the specific screen. It's all static stuff like TextViews and images, so I don't have to do

change fragment(?) layout or activity using a navigation drawer

时光毁灭记忆、已成空白 提交于 2019-12-23 07:29:03
问题 I'm trying to use the new Navigation Drawer . I followed the guideline and I managed to have it working with section names title changing on item selected and so on. Now I'm stuck because I have no idea how to archive what I want to do next. When I click on an item in the drawer - home , for example -I want it to bring me to a screen where I have all the stuff I created in a particular layout for the specific screen. It's all static stuff like TextViews and images, so I don't have to do

Adding buttons programmatically to a fragment

非 Y 不嫁゛ 提交于 2019-12-23 07:15:31
问题 I'm trying to programmatically add image buttons to the fragment that is a part of a viewpager. I tried different codes, but no button shows up even though Eclipse returns no error. I found a similar question here but the answers didn't help me make my buttons appear. Here is my code. public class ViewPagerFragment extends Fragment { private ViewPagerActivity mViewPagerActivity; private String mId; public ViewPagerFragment(String id) { mId = id; } @Override public void onAttach(Activity

Why does popbackstack call onCreateView of the fragment?

限于喜欢 提交于 2019-12-23 06:56:45
问题 Trying to figure why onCreateView is called when I popbackstack the fragment. Using the following code: fragmentManager.popBackStack("tag1", 1); ft = fragmentManager.beginTransaction(); ft.remove(fragmentManager.findFragmentByTag("tag1")); ft.commit(); Logcat: FATAL EXCEPTION: main java.lang.IndexOutOfBoundsException: Invalid index 79, size is 79 at java.util.ArrayList.throwIndexOutOfBoundsException(ArrayList.java:255) at java.util.ArrayList.get(ArrayList.java:308) at edu.pacific.pocketrx

How can I pass a String between fragments?

耗尽温柔 提交于 2019-12-23 06:21:01
问题 I know there are already some questions about it, but none of the answers work out for me. I want to pass the String inputEmail from StartFragment to SignInFragment. I tried to do this with the bundle: StartFragment SignInFragment fragmentTwo = new SignInFragment(); Bundle bundle = new Bundle(); bundle.putString("key", input_mail); fragmentTwo.setArguments(bundle); SignInFragment: View view = inflater.inflate(R.layout.fragment_sign_in, container, false); Bundle bundle = getArguments(); if