Tag: android-activity

Relationship between android:noHistory and android:finishOnTaskLaunch

How do these two attributes relate? If I have android:noHistory=”true”, does having android:finishOnTaskLaunch=”true” have any significance/meaning?

what is the different between onCreate() and onCreateView() lifecycle methods in Fragment?

I don’t know when to use onCreate() or onCreateView(). I have used onCreate() and onCreateView() lifecycle methods. I think onCreate() for Activity and onCreateView() for Fragment. But I am not sure. Can I use onCreate() LifeCycle method in Fragment? I hope somebody can help me!

Discovering if Android activity is running

I’m using C2DM, my BroadcastReceivers propagate the C2DM events to a local service. the service complete the registration by sending the id to my webserver pus it’s responsible for letting the device know about new messages, however if the application (one of the activities) is up we want to send an intent to that activity […]

Android: Pass List<GeoPoint> to another Activity

I have an ArrayList of type GeoPoint. private List<GeoPoint> points = new ArrayList<GeoPoint>(); I want to pass points to another Activity and retrive the data in that activity. How do I do it? I know I have to use the parcelable but I searched, but could not find a way to pass ArrayLists.

startActivity within a subclass of Application

I have a little Android application in which I specify my application directly and do some application-wide setup in the ApplicationSubclass’ onCreate, but I am getting the following error (Note, I know about FLAG_ACTIVITY_NEW_TASK): Caused by: android.util.AndroidRuntimeException: Calling startActivity() from outside of an Activity context requires the FLAG_ACTIVITY_NEW_TASK flag. Is this really what you want? […]

Android PagerView between Activities

I have five activities/screens that I would like to be able to swipe between, each has a different function but are interrelated hence the UI concept of swiping between each. I have found many discussions around ViewPager and PagerAdapters etc. but cannot seem to find one where swiping switches between different activity screens. Is this […]

How do I close out of Google Navigation programmatically?

I am starting Google Navigation through an Intent: private static final int GOOGLE_NAV = 5; Intent intent = new Intent(android.content.Intent.ACTION_VIEW, Uri.parse(“google.navigation:q= some + address”)); startActivityForResult(intent,GOOGLE_NAV); I then check if the user has reached his destination via a LocationListener. If the user has arrived, I want to close the Google Navigation activity. if(hasArrived()) { finishActivity(GOOGLE_NAV); } […]

How to be notified when activity/task changes in Android

I’m building a system status logger. I’d like to be notified when any activity/task is brought to the stop of the stack and becomes visible by the user (not just the one I wrote). ActivityManager makes it possible to work out what’s on top: http://developer.android.com/reference/android/app/ActivityManager.html however, this requires that I frequently poll to recalculate what’s […]

Activity not closing on Back press when theme is Theme.NoDisplay

I am setting Activity Theme to Theme.NoDisplay but When it open but on press back button Activity not closing/destroying. It should close/destroy on back press. Guys help me why this is so and any solution to resolve this. public class MainActivity extends Activity { // Tag of the Activity private static String TAG = “MainActivity”; […]

Hiding keyboard after calling new Activity that shows a ProgressDialog

I’m having trouble with the on screen keyboard. I have an activity with an EditText which shows the keyboard, and a button to go to a second activity. The second activity shows a ProgressDialog on its onCreate(), does stuff, and dismisses the ProgressDialog. The problem is that while the ProgressDialog is displayed, so is the […]

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