Tag: android-activity

Admob on Multiple Activities?

I have 7 Activities in my application. I wants to display admob in every activity Whether i have to create each AdView in every activity? or is there any alternative to reuse previous activity container OR prevent it from destroy so can i use in next activity…. Any code or hint we’ll b appreciate. Thankx

Send data backwards to a previous activity

I would like some help in sending data backwards to an Activity that is already running. I want the user to be able to select an option from a list and then that selection be used in a previous activity. I know how to do it going forward using intents but can’t see how that […]

ActivityLifecycleCallbacks are not triggered when activity is killed through “Don't keep activities”

In my Android app I have two activities: DemoActivity with a button to start the SearchActivity with an Intent SearchActivity The button is a custom ViewGroup: SearchButton As soon as the SearchButton comes to life it registers for lifecycle events (of the corresponding SearchActivity): public class SearchButton extends CardView implements Application.ActivityLifecycleCallbacks { @Override protected void […]

Android: Activity.onDestroy() is not called when Dalvik kills this Activity

I’m confused about Activity.onDestroy(). I need to free some resources when my Activity is destroyed, but it seems like onDestroy() is called just when i press “Back” key, but not when my Activity is killed by Dalvik. I tested it just by adding log: Log.v(“my_tag”, “onDestroy() called”); and the same in onCreate() method too: Log.v(“my_tag”, […]

Android – event listener

I hope this will be simple question. I have main activity, on this activity I create an instance of some class. How to send some event form one class to main one? How to setup some kind a listener to send notifications between classes. Only option what I know/use right now is to keep reference […]

How to get a PERMANENT application notifier in the status bar?

I searched on the Internet alot but cant find a proper answer to this. I have used apps like 3G watchdog and Advanced task killer on my android phone. I noticed that they always have an icon up when the status bar is minimized and also have a notification( Upon clicking opens the app) which […]

Change and apply theme at runtime in Android

Possible Duplicate: How to change current Theme at runtime in Android I have an Android application where I allow users to switch between themes at runtime. Switching a theme is easy but the theme isn’t applied until the activity is recreated. I found a way to apply the theme to current activity but if the […]

How to add a hyperlink into a Preference Screen (PreferenceActivity)

I would like to add three hyperlinks a Preference screen, which makes use of the PreferenceActivity if possible. Can I do this, if so, could someone provide support? Many thanks,

How open new activity clicking an item in listview?

I can’t start a new activity clicking over an item in my listview. I want that onItemClick can open the ApkInfoActivity.. Actually when i click nothing happen. protected void onItemClick(ListView l, View v, int position, long id, AdapterView<?> parent) { super.onListItemClick(l, v, position, id); final ApplicationInfo app = applist.get(position); PackageInfo packageInfo = (PackageInfo) parent.getItemAtPosition(position); AppDataActivity […]

Update tabs from a tab's activity in a Android TabHost

I have a TabActivity and am going to have 3 or 4 tabs. In TabA, I would like to have an ExpandableListView, which will list products. I would like TabC to act as a sort of “shopping cart”, probably with a ListView of itself. Is there a way to interact with the TabHost from the […]

Android Babe is a Google Android Fan, All about Android Phones, Android Wear, Android Dev and Android Games Apps and so on.