I need to disable showing the tab bar above keyboard when its up for only specific tab.
I've searched and tried several ways:
android:windowSoftInputMode="stateVisible|adjustResize|adjustPan" works but for all tabs. I need only for one tab
The only way i think should work is to send broadcast from the tab fragment to the TabActivity, it works fine but when dealing (typing/deleting) with the only edit text in the fragment something goes wrong in the tab bar goes up with the keyboard again.
The broadcast is: (Tab fragment):
Intent intent = new Intent(TabActivityName.ACTION_SET_SOFT_INPUT_MODE);
intent.putExtra(TabActivityName.SOFT_INPUT_MODE, WindowManager.LayoutParams.SOFT_INPUT_ADJUST_PAN);
getActivity().sendBroadcast(intent);
And from the TabActivityName the broadcast is being called successfully and do:
getWindow().setSoftInputMode(intent.getIntExtra(SOFT_INPUT_MODE, 0));
So my main issue is what can cause the tab activity to disable/reset/forget this softInputMode
thank for the help
Related
I know the title looks weird but this is what I want :
I have two tabs, and under one tab I have an activity that has a file list. When you click on a file it normally shows a panel next to it (which is another activity). But now, since I have tabs, when I click on a file it jumps to a full screen activity with the file description and the tabs are gone. I would like to make this second activity a sub-activity of the main where we can select a file so that the tabs stay still.
Any ideas ?
Thanks,
Nic.
Tab host with fragments should solve the issue.
You may like to read this - http://android.codeandmagic.org/2011/07/android-tabs-with-fragments/
I am working on a Tab Activity. I have one activity as a tab content
of one tab. I need to use the same in another tab also.so I have set
the a single activity as a two tab content. But when I am running my
code . If I am selecting the TAB1 after that I am selecting TAB2.
Again I coming back to TAB1. whatever event like entering name in
edittext is reflecting in TAB2 not in TAB1.I don't know understand why
its happening.
Any Idea? Thanks in Advance.
You haven't mentioned that what you are doing onTabChanged ie. whether you are starting that activity again or not.
I think everytime when you are selecting a tab you are staring an Activity.
startActivity(intent);
So, whatever change you have made in that activity under Tab2, won't reflect on that activity under Tab1 as you are starting that activity again.
If you are starting that activity everytime ontabchanged, then you have to save the changes what you have made under any tab.
As you haven't mentioned clearly what you are doing, so if you are doing something else, let me know.
I have a Tab bar application with two tabs named "Tab1" and "Tab2".
Whenever I launch the application ,the Tab Bar runs and the "Tab1" in the Tab Bar get selected and it runs an Activity, because I have used setCurrentTab(0) method.
So how can I run the Second Tab named "Tab2" simultaneously along with the "Tab1" without clicking. Here I cannot use setCurrentTab(1),because I have already used setCurrentTab(0).
Any suggestions as to how I can do this?
first navigate to the second tab then come to the first tab.
setCurrentTab(1);
setCurrentTab(0);
so the second tab will be onPause state do whatever you want to do on second tab.
I'm creating the 3 tabs dynamically based on example here http://developer.android.com/resources/tutorials/views/hello-tabwidget.html
the application works well except one issue.
when I launch app and then click the Back Button then the app closes.
I launched the app by clicking on the application icon.
now I can see 6 tabs. each time I repeat this process, it keeps on adding 3 tabs.
when ever I use Menu button instead of back Button then it doesn't add 3 tabs.
anything going wrong here, how can I fix it?
thanks
Are you creating the tabs at onResume() or onStart()? Try to create them at onCreate()
or delete the tabs by onPause with something like:
LinearLayout tabbar = (LinearLayout) findViewById(R.id.tabbar);
tabbar.removeAllViews();
I have created a TabActivity in my android application. When user selects the second tab, an alert dialog will appear. Is there any way to navigate to the previous tab when user clicks the cancel button for the dialog box.
regards
dj
I found the solution here:
Android - Switch Tabs from within an Activity within a tab
In my case, I have used the solution of 'GrandPrix'.
I think you need to first know about the Tab Widget:
http://developer.android.com/resources/tutorials/views/hello-tabwidget.html
http://www.androidpeople.com/android-tabhost-tutorial-part-1/
You can set the tab using setCurrentTab method:
tab_host.setCurrentTab(2); // 2nd tab button is showing initially
same way, you can set the tab-button on the cancel button.