Android :: How To Set New Content In Existing Tabs Upon Menu Button?

May 20, 2010

I recently started Android programming and was working on my first program which displays a historic text document, sectioned by tabs via TabHost.I have limited my program to one activity and merely used setContent in my TabSpec's to switch between different XML views.The document has both unedited and corrected versions of the text for which I have built text views to accommodate. I wanted to implement the standard menu to have buttons to "view corrected" and "view original" and switch the content of the tabs which have changes (without altering the tabs or their indicators).I've read on the TabHost API and there is no way to edit existing tab content with setContent() of TabSpec; and AFAIK TabWidget only affects the actual tabs, not the content that is displayed upon pressing them.I've thought about creating a new class which extended TabHost and super() all of the original methods, while including one more which updated the mTabSpec list.

Android :: How To set new content in existing tabs upon menu button?


Android :: Existing Patches For Tabwidget To Allow Tabs On Left-hand Side?

Aug 16, 2010

My employer is having me work on an android application with very specific UI requirements. Specifically, we need an interface that looks exactly like a TabWidget interface. However, having the tabs on the left hand side is an absolute must. We aren't going to be deploying this application to any android phones, its for an in house device, and as such don't have any problem violating any design considerations that the android platform might have.

We already have a working prototype that hacks together the functionality we need using a combination of focus listeners and list views. It isn't pretty, and we aren't very confident in it just yet, but it works for the time being.

What we'd really like is to throw all of our prototype UI code away in exchange for using the built in TabWidget. However, since TabWidget is hardcoded to only work with the tabs on top, this isn't really an option.

So, we are hoping that someone out there has a patch, or set of patches, or perhaps a custom class, that handles the TabWidget functionality with the tabs on the side instead?

The relevant code for the TabWidget is here: http://www.google.com/codesearch/p?hl=en#uX1GffpyOZk/core/java/android/widget/TabWidget.java&q=android%20package:git://android.git.kernel.org%20lang:java%20tabwidget&sa=N&cd=1&ct=rc

And the specific function that is hardcoded for being tabs on top is

CODE:.......................

View 1 Replies View Related

Android :: Content In Tab - Change It With Out Losing Parent Tabs

Nov 20, 2010

I have been asked to create an app to buy sell and advertise a product. I have chosen dvd's to keep it simple. Using the tutorials on the android developer site I have created 3 tabs one for PG films one for 15 and one for 18. Now in these tabs I want to have a button that then changes the content of the tab but keeps the tabs.

I have tried so many things and the only thing I have been able to do is start a new activity but that gets rid of the tabs :( and I have tried many other things been up all night trying to work this out. If someone could just point me in the right direction to how to go about this would be great. Is it even possible?

View 1 Replies View Related

Android :: Replace Existing TabHost Content / Activities?

Nov 16, 2009

Since the TabHost API does not offer a way to change existing views or activities, what is the preferred means to replace an existing tab?

I only know of: clearing the tabs and adding them again. Is there an alternative? Or is this really not provided by design?

View 2 Replies View Related

Android :: Possible To Write Custom Content Provider For Existing System Database?

Dec 9, 2009

Not sure of the absolute utility of this but seems as though it should be possible and useful. Can you extend ContentProvider to provide URIs representing new queries (i.e., joins across multiple tables not specified by existing URIs) for an existing system database? The alternative seems to be that I need to write a series of cursor queries then join them -- seems like a lot of unnecessary code duplication.

I have been trying this for the contacts database as an exercise, but no love so far. The crux seems to be that I cannot open a database in another package during the setup phase. Am I just completely out in left field here? It's possible as I am new to both Java and Android.

View 1 Replies View Related

Android :: How To Rename Existing Menu Item

Dec 31, 2009

Do you know how to rename existing menu? I can rename when press menu item. But I don't know how to access to menu item when press the button.

View 3 Replies View Related

Android :: Change Activity In Tabs On Button Click?

Nov 20, 2010

I am creating an android application in which uses tabs. There are three tabs which runs different activities. Activity which runs tab 1, has a button. I want to change content of Tab 1 by clicking on that button. But If I call another activity it doesn't start in tab1 but replaces tab.

View 5 Replies View Related

Android :: Browser Application To Open And Display Content From Menu

Jul 13, 2009

Here's what I'm attempting to do. I have a menu and when a user selects a particular option in the menu I want the browser application to open and display the web page. However, I cannot seem to do this. My application uses a TabWidget to display its content (which works perefectly) but I cannot for the life of me figure out how to open a link into the browser. I have tried adding a WebView to the TabWidget (but when I request it from the view by findViewById(...) I get a null.

I've also tried creating a separate view and performing a setContentView(...) and then I get an exception. I've also tried using an intent I've seen demonstrated on this group. It seems like this should be fairly easy, but I must be missing anything. I've looked at the sample apps as well as the Apps-for- android samples and have followed them to the T, yet still to no avail I cannot get the browser to open (or anything like that).

View 4 Replies View Related

General :: Spice Mi355 - Menu Button Change To Option Button

Nov 7, 2012

i update ics in spice mi355 bt in my phone status in about phn only 2.3.6 only show it bt looks are change.and menu button change to option button clockwise.hw do i knw whther ics change in phn or nt?bt file is download in our forum 1ly size is 90 mb.

View 1 Replies View Related

Android :: Scrollable Tabs - Dolphin Browser When Using Multiple Tabs

Jun 19, 2010

I'm currently working on my first android application. I am using a tabbed layout for my application. I followed the tutorial for this on the dev guide and ran into a problem. The tutorial only used three tabs, but I have a need for more. As such, the tabs resize and bunch up. I was hoping someone could tell me how I can make them scroll, like in dolphin browser when using multiple tabs.

View 1 Replies View Related

Android :: TABS In 2.0 Vs 1.5 - Rounded Corners TABS

Feb 27, 2010

I simply use the tabwidget :

CODE:..........

Why are my tabs so uggly in 2.0 (no more rounded corners as in 1.5/1.6) ?

ugly tabs here

=>

This was better

What should I do now to show "rounded corners" TABS to Nexus One (for exemple) users ;-) ?

Is it because of the following manifest lines :

CODE:................

I have to keep android:anyDensity="true" otherwise I've got a problem with re-sizing of the menus described here

As a separate question, my users can change the Locale within my app itself, I then "redraw" the menus using onPrepareOptionsMenu (Menu menu) to refresh the strings within the menu with the new language choosen by the user. Is there an equivalent for TABS (I have local strings within the Title of the TABS) or do I have to delete all the tabs and re-create them from scratch ?

View 2 Replies View Related

Android :: Tabs - MapView - Activities Within Tabs

Oct 19, 2009

We're in the process of writing an app that has 4 tabs: Map, People, Places, Events. The People, Places, and Events in the App show up as Icons on the map. By default the People, Places, and Events tabs each show a listview, custom rendered, displaying all the People, Places, and Events respectively.

Now, right now each of the tabs has as its content an Intent set to launch the corresponding activity. For instance, there is a MapTabActivity that extends MapActivity, a ShowPeopleListActivity that shows the people, and so on and so forth.

I see a lot of StackOverflow questions/answers saying that due to various limitations in the way the TabHost is setup, it's best NOT to use activities as the content of tabs. For instance, it's impossible to launch a new activity and have it take the place of the existing activity within a tab, whereas it's possible to switch out a View with a different view.

Now, I'm at a crossroads. We've (for better or worse) devoted a fair amount of time trying to get this app to work the way it's currently structured, with the Activities as the content of the tabs. When an icon corresponding to a Person, Place, or Event is clicked, it fires off a VIEW Intent on a URI corresponding to that object; this is picked up by an Activity that then shows the object. The same mechanism is at work both in the Map and in the individual lists. We really like the loose coupling this provides us; we just give a VIEW command and the URI to the person/place/event and it automatically brings us to the right activity. Granted, the activity that's launched covers up the tab view rather than appearing inside of that, but we were willing to live with this.

Here's an issue though: from the Show activity, we want to be able to go back to the map, centered at that person, place, or event. We can launch a new activity to show the map again, but now we have the map activity as the content of the tab, plus the show activity, plus the new map activity in the activity stack; given how resource intensive the map activity is, I'm guessing this is not the ideal way to go.

I guess my question is, is there a GOOD tutorial somewhere showing exactly how to do complex tasks with a TabHost? I've seen HelloTabWidget; I'm looking for something much more sophisticated than this. I'm worried that if we switch to the View based way of doing things, we'll have to do a LOT of housekeeping to intercept all the back events, try to switch out the views, etc., etc., as well as strongly coupling our program in a way we don't want.

View 5 Replies View Related

Android :: Tabs Layout - Tab Activity With 4 Tabs

Nov 11, 2010

I have an Tab Activity with 4 tabs. Each of tab is showing me the list view. Suppose i m on 4th tab and dragged the list view to the last position and after that i click on 3rd tab and again when i go to 4th tab it is not refreshing and showing me the last visible screen. Actually i want to show the list view again from 1st element. is tabs refresh automatically or we need to do it programmatic?

View 1 Replies View Related

Android :: Change Content Of Tab On Button Click

Aug 20, 2010

I have been reading a lot of comments on how it is more lightweight to use views instead of intents in setContent when using tabs.

Since I will be creating an app with tabs, I am trying to implement this instead of having intents inside setContent. However, I am having a difficult time looking for examples or straightforward tutorials on swapping the current view with another one.

Say I have TAB_A, with some entry fields and a button. When the user clicks on the button, a TextView will display "Hello, user!" in the same TAB_A. Of course this is an oversimplified example, but it will surely point me in the right direction.

EDIT: I have a tab called TAB_A with a button in it. If the user clicks on that button, TAB_A will now display "Hello, user!" instead of the button.

Here is a sample of my TabSpec.

CODE:..............

Where ShowButton and ShowHello are classes both extending LinearLayout. Both are initialized in onCreate like this:

CODE:.............

When the app first starts, the user sees the view showButton. When the user clicks on the button, I want the tab to change its contents to showHello.

The question then is: Is there any way to update the contents of the tabspec without using startActivity?

View 2 Replies View Related

Android :: App For Broken Menu Button?

Jul 22, 2010

Recently the home and menu buttons of my HTC hero broke down. I found an app, "soft home" which creates a home button in the notification bar.Does anyone know of an app which does the same thing for the menu button? While Im on it, a second question: My browser which is the default browser of the hero goes full screen. This causes the notification bar to dissappear thus making the home button app useless. Does anyone know how to turn this fullscreen feature off/know a good browser which does not do so.

View 1 Replies View Related

Android :: Customizing More Menu Button Icon

Jul 27, 2010

I was wondering if it is possible to customize the icon used for the More menu option (displayed when there are more than 6 menu options)? With the stock vanilla Android UI it appears as a disclosure-type arrow and on HTC Sense UI it's an ellipsis icon. Curious if these are fixed icons only defined in the Android resources or if there is a way to programmatically set them?

View 1 Replies View Related

Android :: Any Way To Open Menu From Button Widget?

Sep 15, 2010

Is there a way for a button to call a submenu? I currently have a menu where if they select one of the options it opens a submenu, however I want to be able to start the submenu from the Button widget instead of the Menu object.

View 3 Replies View Related

Android :: Add Button Or Menu In Contacts List?

May 14, 2010

I am using following code to open Android Contacts

CODE:.............

Now i want to put Button at the top of this Contact activity when opened or add my own Menu in this Activity.

View 2 Replies View Related

Android : Menu Button Unlocks The Phone / How To Fix?

Apr 15, 2010

I have HTC Hero and I've found out that dragging down on the touch is not the only way to unlock the phone. If you press the menu button, it unlocks the phone, too. I don't know whether it's problem of the HTC device, Android or bad feature definition.

View 2 Replies View Related

Android : How To Add Button / Menu Item In Droid?

Jun 6, 2010

I m a novice in android.. i want to add a button or menu item in message inbox or email. how can i do so.

View 2 Replies View Related

Android : How To Change More Button In Expanded Menu?

May 4, 2010

May someone please tell me how to change the text "More" of "More Button" in an expanded menu to other strings?

View 2 Replies View Related

Android : How To Create A Donate Menu Button?

Oct 30, 2010

You need to have Internet permission. Instead of using thewebview, you are better off using the Bowser activity for this.

View 8 Replies View Related

Android :: How To Capture Long Press Of Menu Button?

Jul 27, 2010

How can I capture a long press of the device menu button in my application?I thought of an intent filter, but there's only an action called android.intent.action.SEARCH_LONG_PRESS, but nothing for the MENU button.I found that long press of the menu button actually does different things on different devices,i.e. on Nexus One it will show the soft keyboard, while on Samsung Galaxy S it will pop up the search widget.

View 5 Replies View Related

Android :: Want To Add An Exit Button To The Menu / Way To Close Application

Aug 10, 2009

i want to add an exit button to the menu, but didn't see an easy way to close an application or acces all activities of an application and finish them. Is there an easy approach available?

View 11 Replies View Related

Android :: Ddroid Device Has A Menu And Back Button?

Nov 11, 2010

Kind of new to Android, and definitely don't know too much about the devices. I was wondering whether every android device out there has a menu and back button? I just wanna make sure we could assume this as a fact...

View 3 Replies View Related

Android :: Menu Button Not Working On Emulator In Maps Application

Jul 19, 2010

When i am trying to run the example of Maps as in http://developer.android.com/resources/tutorials/views/hello-mapview.html, the menu button doesn't seem to work. I tried the default Maps app in the emulator and there it was working. Also i intend to add an item when a user presses that button, how can do it?

View 2 Replies View Related

Android :: Create A Soft Home - Back - Menu Button

Nov 9, 2009

I am working on a device that does not have a hardware Home, Back or Menu button. I am trying to create a soft keyboard with only these three keys but I have not been able to get it working. Does anyone have any insight into my problem?

I first looked into injecting keypresses into a WindowManager but this functionality seems to have been removed.

I then looked at creating a custom soft keyboard but that will not work either. Custom soft keyboards only inject their input into the text fields they are attached to. I can't send a Home, Back or Menu keypress to the Android system.

I finally got the Home button working by using this intent to tell Android to go to the Home screen: Intent HomeIntent = new Intent(); HomeIntent.setAction(Intent.ACTION_MAIN); HomeIntent.addCategory(Intent.CATEGORY_HOME);

Unfortunately, I have not found an Intent to send for Menu and Back.

View 2 Replies View Related

Android : Way Return To Main Menu In Droid By A Button Click?

Nov 22, 2010

In android, my app provides a button that the user can click to return them back to the screen that appears when the app is opened (onCreate). How can I set that button to return the user to the main menu?

View 2 Replies View Related

General :: Any App Or Menu From Android 4.3 To Reboot Phone Without Using Power Button

Oct 20, 2013

Is there any app or menu from android 4.3 to reboot the phone without using power button. The phone does not rooted.

View 1 Replies View Related

How To Use Settings Menu Button

Jul 22, 2012

API 10

/res/menu/main_app.xml

Code:

<menu xmlns:android="http://schemas.android.com/apk/res/android">
<item android:id="@+id/menu_settings"
android:title="@string/menu_settings"
android:onClick="showSettingsMenu"
android:orderInCategory="100" />
</menu>
/src/com.my_app/MainActivity.java

Code:

public void showSettingsMenu(View view){
setContentView(R.layout.settings_main);
}

im supposed to go to the settings screen after pressing the menu button on the phone and pressing on the "Settings" option.but it isnt happening.

View 3 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved