Tag: android-activity

Finishing an activity from another class

I am working on an app that requires a permanent internet connection. If no internet connection is present I want the user to be logged out of the app (taken to the login screen). I have a network receiver class that detects network connectivity. I want this class to either terminate the activity on top […]

Android Activity Not Showing When Screen is Woken Up and Lock Screen Not Disabling

I have a BroadcastReceiver that starts an Activity. If the Activity is started while the screen is on, it displays and everything is fine. However, on ICS and JB devices (I haven’t tested GB or HC but the issue doesn’t exist with Froyo) if the Activity is started while the screen is off, the lockscreen […]

Android clickable Widget with ListView not clickable on ListItems

I am having trouble making my Widget clickable. The following code is working partially. My Widget shows a ListView with Items. When clicking into the Widget where no Item is displayed, the Intent works and the Activity starts. But when clicking on an Item of the ListView nothing happens. Here is the Code: WidgetProvicer: public […]

Command pattern to pass application's activity methods?

After reading the the Avoiding memory leaks article by @RomainGuy I realized that my current Android application is plagued with the mistake of passing the application’s main activity around. So whenever I, can I simply replace that activity parameter with Activity.getApplicationContext(). But there are certain classes in my application that still need to run methods […]

Activity return a image

I want to return a bitmap in my activity, so other applications can use it. Returning a text is clear. Intent data = new Intent(); data.putExtra(“text1”, “text.”); data.putExtra(“text2”, “longer text.”); setResult(RESULT_OK, data); But how to return a bitmap? More Information: The activity has several intents to be available for everyone who wants to get a […]

What happens when you click on an application's launch icon?

¬†What happens when you click on an app’s launch icon? Is a new intent always sent, or is the result sometimes the same as resuming a task from recent tasks? If an intent is sent, when does it get sent to the onCreate() method of a new activity instance and when does it get routed […]

Restore Android back stack after app has been closed

What’s the best practise to manage / restore application back stack between multiple sessions ? Exemple of a Workflow : Activity A started (stack: A) Activity B started (stack: A B) Activity C started (stack: A B C) … User uses a different application (let’s say the GMail app) for a while … User goes […]

How to get current on screen activity?

Possible Duplicate: Android: How can I get the current foreground activity (from a service)? In a method I have to know which activity is on the screen. How do I get the current activity?

Why doesn't the function get data from php in android?

I want to get response after post data but it fails. I want to create a login system, I have successfully submited data to php file, everything is working fine now I want to get response from same function but I’m unable to know where the issue is. Here is the Java function: public class […]

Activity Recognition in Android is not working

I have tried to compile example code from new Google location API that should show user’s activity. Like on foot, in vehicle etc. Link to the example is http://developer.android.com/training/location/activity-recognition.html In my case what I can see is that Google Play Services is available, Location Services connection goes fine as well but nothing afterwards. onHandleIntent never […]

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