Android :: Change Label Of Activity At Run Time
how can i change value of a Activity label in AndroidManifest.xml file through the code in java. welcome your response.
View Complete Thread with Replies
Sponsored Links:
Related Forum Messages:
Android :: Launcher Label Vs Activity Title
I want to give my application launcher icon (the one that is displayed on the startscreen!) a different, shorter caption. It seems the launcher takes its label from the mainfest section about the main activity's label, as here: <activity android:name="MainActivity" android:label="@string/app_short_name"> <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> I already changed the original reference to my app's name @string/app_name to a different, shorter string resource here. BUT - big BUT: this also of course changes this activity's default title! And I did not want that to happen, there's enough space for a long application name! Setting the long title again in onCreate using the setTitle(int) method does no good either, because the short name will be visible to the user for a short time, but long enough to notice! And - please don't answer my question by refering to a custom titlebar... I do not want to go that long way, just because of a stupid string title! It's a pain to draw a custom title bar for so little effect! Is there no easy way to just give the launcher a different string to display?
View Replies!
View Related
Android :: Access / Change Text Label On Tab?
I have an Android app with 3 tabs in a TabHost (text labels, no images). I set up the tabs like so: intent = new Intent().setClass(this, AnnouncementsActivity.class); spec = tabHost.newTabSpec("news").setIndicator("News").setContent(intent); tabHost.addTab(spec); I start up a background thread to fetch announcements from my server and I want to update the text label on the tab to tell the user how many new announcements there are. For example, I want to change the text on the Tab to "News (3)". How can I access and change the text label on the tab?
View Replies!
View Related
HTC Hero : Way To Change Size Of Icon's Text - Label
Just got the HTC Hero from Sprint and so far am loving almost everything about it. One question that I hope someone can help me with:Is there a way to change the size of icon's text or label (or perhaps the text itself)? For example, I have a screen with several Google apps on it, but they look like this: "Google M..." (for Google Maps); "Google S..." (for Google Sky), etc. It would be great if I could just change this to "Maps" or "Sky."
View Replies!
View Related
Android :: Orientation Change Crash In Tab Activity With List Activity
When views with different type have same id and screen orientation changes, either java.lang.ClassCastException: android.view.AbsSavedState$1 or java.lang.IllegalArgumentException: Wrong state class -- expecting View State will occur. (depends on the view's order) Because View.dispatchRestoreInstanceState() checks id only. You may wonder why anyone would make views with different type to have same id. But it can happen when you use tab activity. Imagine you have tab activity with two children activity. Tab1 is ListActivity and Tab2 is ExpandableListActivity. Both activity have id of "@android:id/list" but the type of view is different. This means we cannot use ListActivity & ExpandableListActivit at the same in one tab activity.
View Replies!
View Related
Android :: Change Intent Bundle Data Before Activity Recreated After Orientation Change
I have a notification that starts my activity and passes a messages using the intent's putExtra() function. The message is then displayed to the user in the activity's onCreate function. When the application is restarted due to a orientation change, the message is shown again as it is still in the intent's bundled data. How can I remove the extra data? I tried the following: Bundle bundle = getIntent().getExtras(); if (bundle.getBoolean("showMessage")) { // ... show message that is in bundle.getString("message") // remove message bundle.remove("showMessage"); } But the message will still be shown after the orientation changed, seems like the intent used is not the one I changed, but the original one. The only workaround I found is to save the showMessage additionally in onSaveInstanceState(). Is there another way? Or is this the way to go?
View Replies!
View Related
Android :: Launch Activity At Certain Time
I'm new to Android development, so I might be missing something obvious. I want to launch an activity when the user's phone clock hits a specified time (similar to an alarm). However, I'm not sure how I would go about doing this as constant polling of the clock seems inefficient and a waste of resources. Do I need to capture broadcast events from the lclock, or use PendingIntents?
View Replies!
View Related
Android :: Changing Content Of Activity Run Time
I created an activity by using a layout written in a XML file. I would like, in response to some events, to change the content of this activity. I would like to show a VideoView over the content. In response to some other event, I may want to go back to the first content. Would it be possible to switch the content of the activity this way without running another activity (I have another technical difficult in doing that)? I tried using setContentView( videoView), and then switching back with setContentView(T.layout.main), but it seems that, when going back to the main layout, all my buttons and text boxes are created again as they were new. Would it be possible to go back to the last state of all the controls?
View Replies!
View Related
Android :: Change Key Width Run Time
I want to change the key width in keyboard at runtime. The constructor of class Keyboard only accepts the layout resource ID. I tried setHeight method, but it didn't work obviously when I checked the code of Keyboard. Any solution? Do I have to implement my own Keyboard
View Replies!
View Related
Android :: Activity Repeate After A Definite Interval Of Time
I have an activity image Capture.java which extends activity and takes pictures.I want to execute this activity repeatedly after a definite interval of time. I can't figure out how to do this. Do I need to make Image Capture a service? This is what I want to do As soon as the user press start I want to keep taking pictures in the background..When the user presses stop,it should stop image capture.Java.
View Replies!
View Related
Android :: Change Widget Size At Run-time
Is it possible to change widget size at run-time? I want to provide users with an option to chose size of the widget from configuration utility but can't figure out how to do that. The only way to specify size of the widget seems to be to explicitly do that in AndroidManifest.xml
View Replies!
View Related
Android :: Want To Auto Change Time Zone - Any App?
I travel each week to Brussels from the UK and don't want to keep switching my current time zone.I have tried setting 'Automatic' in the Time & Date settings but it does not seem to do anything, but maybe this is because I have data disabled (cos I don't have a data pack).Is there an App that will use GPS to automatically alter the time zone setting?
View Replies!
View Related
Android :: Change Text View At Run Time
i“m working with a lineal layout and I“m trying to change the text of a TextView but it doesn“t refresh. When I debug I“ve checked that the text have changed correctly.public class Position extends Activity { Button botonempezar; Button botonsalir; TextView text; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.position); botonsalir = (Button) findViewById(R.id.salir); botonempezar = (Button) findViewById(R.id.Empezar); text = (TextView) findViewById(R.id.Textoposicion); botonsalir.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { onDestroy(); finish(); } botonempezar.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { // TODO Auto-generated method stub searchPosition(); private void searchPosition(){ boolean condition = true; do{ determinatePosition(); }while(condition == true); private void determinatePosition(){ this.text.setText("New text"); //this.text.invalidate(); this.text.postInvalidate(); Toast.makeText(getBaseContext(), "New text", Toast.LENGTH_SHORT);// this doesnt work neither. Here I post the code of the xml file. Its really silly but it could be the problem: <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent"> <TextView android:layout_height="wrap_content" android:id="@+id/Textoposicion" android:text="Posición desconocida" android:layout_width="fill_parent" android:layout_marginTop="20dip" android:inputType="text"> </TextView> <Button android:layout_height="wrap_content" android:id="@+id/Empezar" android:text="Empezar" android:layout_width="fill_parent" android:layout_marginTop="20dip"> </Button> <Button android:layout_height="wrap_content" android:id="@+id/salir" android:layout_marginTop="20dip" android:text="Finalizar programa" android:gravity="center" android:layout_width="fill_parent"> </Button></LinearLayout> I have edited the post because I omitted part of the code to make it simpler but I think I may suppressed the problem too. It runs in a endless loop, could be this the mistake?
View Replies!
View Related
Android :: Displaying Real Time Information During The Execution Of An Activity
I want to display the status of the activity execution on the screen using the TextView while activity is executing. I am appending the String messages at different stages of execution in the TextView, which is defined in the Layout main.xml (e.g. TextView.append("Server started.."). For e.g. I am running socket communication application in which my android application is the server and it is receiving the messages from the local desktop. So in this application I want to show "Server started.." message when socket server on android started , then a messge "waiting for message.." and then "message receivied.." when message received by android server.All 3 steps are the part of a single activity. But in my case, I am getting all 3 messages at a time after activity execution completed. Is there any API available, using which I can show the status during the execution also.
View Replies!
View Related
Android :: Change Update Time Of Location Overlay
I am trying to see if anyone knows if it is possible to change the update time of MyLocationOverlay (http://bit .ly /dBIVdj). I have tried subclassing MyLocationOverlay and implementing my own location manager but when that happens I do not see the overlay on the map. I would try overriding the drawMyLocation method however I don't know which canvas to provide the method (since I would be drawing onLocationChange). To summarize, I am looking to do three things in MyLocationOverlay subclass: 1. Change the location update times to whatever I want. 2. Draw the "my location" dot with the radius when the onLocationChanged() method is called. I've thought about making my own special class with special overlay -- but I feel like there has to be a better method to get what I want out of this class.
View Replies!
View Related
Android :: Change Custom Title View At Run Time
I am using a custom title view in my application for each activity. In one of the activities, based on button clicks I need to change the custom title view. Now this works fine every time when I make a call to setFeatureInt. But if I try to update any items in the custom title (say change the text of a button or a text view on the title), the update does not take place. Debugging through the code shows that the text view and button instances are not null and I can also see the custom title bar. But the text on the text view or the button is not updated. Has anyone else faced this problem? How do I resolve it?
View Replies!
View Related
HTC Incredible :: GPS Time Change?
So been using my DInc and have just noticed something pretty annoying. For some reason the GPS in my phone keeps thinking I am in Xuzhou, I think somewhere in China, which wouldnt be so bad but my phones time switches accordingly. This gets to be pretty annoying as it has almost made me late for work a few times. Just wondered if anyone else is having this problem and if it could be tied back to a certain app?
View Replies!
View Related
Android :: Change Playback Rate Of Track In Real Time
I would like to know if somebody knows a library to changing the playback rate of a track in real time. My idea is to load a track and change its playback rate to half or double. Firstly, I tried with MusicPlayer but is was not possible at all and then I tried with SoundPool. The problem is that with SoundPool I can“t change the rate once the track is loaded. Here is the code I am using (proof of concept): Code...
View Replies!
View Related
Android :: Change Custom Title View Of Window At Run Time
I am using a custom title view in my application for each activity. In one of the activities, based on button clicks I need to change the custom title view. Now this works fine every time when I make a call to setFeatureInt. But if I try to update any items in the custom title (say change the text of a button or a text view on the title), the update does not take place. Debugging through the code shows that the text view and button instances are not null and I can also see the custom title bar. But the text on the text view or the button is not updated. Has anyone else faced this problem? How do I resolve it?
View Replies!
View Related
HTC Hero :: False Time Change In Tenerife
I am in Tenerife, which is technically part of Spain but operates on GMT (same as London back home). The phone insists on showing the time as European GMTplus1 as if I was in mainline Spain. The GPS knows that we are in Puero Cruz de Tenerife, so it is presumably the programming somewhere?
View Replies!
View Related
Sprint HTC Hero :: Change To Partial Awake Time
So this is Ground Shattering news for anyone having sleep issues. If your Hero is reporting 100% awake status, you'll need to find out what the culprit is. Until today I had only known to remove and install apps one by one. A developer just brought my attention to the app Spare Parts. Download Spare Parts from market, open it,>Battery History>drop down menu default is CPU Usage, select and change to partial wake Usage. This will show which apps are keeping phone from sleeping.
View Replies!
View Related
HTC EVO 4G :: How To Change Delay / Snooze Time On Calendar Reminders?
Does anyone know how to change the delay/snooze time on calendar reminders? (I'm not talking about the default time to remind you ahead of an event). For instance, when a reminder goes off, mine currently chimes to remind me every 5 minutes until I dismiss it. I'd like to be able to change it to 10, 15, 20, 30 minutes. Right now, if I'm in a meeting or something and I snooze it, it keeps chiming every 5 minutes and gets annoying to the point where I have to dismiss it. Then I run the risk of forgetting it.
View Replies!
View Related
Android :: How To Change ClassLoader Of Activity?
I newed a DexClassLoader to load one jar file dynamicly.I think I have to set my cl to be default ClassLoader of Activity.to achieve similar thing. However, it does not work. So event I changed Thread's context classloader, Activity's classloader is not my cl.My question is how to change Activity's ClassLoader?
View Replies!
View Related
Android : How To Hide Label On Screen?
Suppose that you create a HelloWorld application under Eclipse. Then in res/values/strings.xml the following entry is created: <string name="app_name">Hello, Android</string> Now, when you launch the HelloWorld application you see the label "Hello, Android" on top of the screen. I want to hide this label. What is the way of doing this?
View Replies!
View Related
|