Tag: android-activity

Cannot open custom file extension

I have a file format I wish to support, it’s just a zip but I’ve renamed it .amg so my app can read it. On my samsung phone with gingerbread it works fine and it opens. On my motorola phone with kitkat all I get is can not open it. I’ve tried various solutions found […]

Android – clear history when navigating between Activities

I have 3 Activities that my user continuously is looping through. When user is back to the main screen I need to terminate previous history so user cannot hit back button and end up on screen #2, what would be a good way to do something like that? BTW – I’m using 1.6 (API level […]

Android's activity lifecycle after coming out of sleep

If an activity is being shown on the screen and has a button with a click listener attached to it, that gets attached to the button during the onCreate method, and then the device goes into sleep mode (or the user taps on the power button to turn off the screen), when the screen comes […]

Activity Transition: Performing stop of activity that is not resumed

I’m trying to use the new API for activity transition only on lollipop (I’m using the compact version tho), so I’m implementing an animation from activity A to activity B, in Activity A: getWindow().setReenterTransition(null); getWindow().setExitTransition(null); getWindow().setAllowEnterTransitionOverlap(false); getWindow().setAllowReturnTransitionOverlap(false); because I’m not interested in enter or exit of this activity, the only animations that I want to […]

Handling onActivityResult from outside the Activity

I’m trying to make a helper class to start an Activity and get the return result (startActivityForResult) to avoid developers writing their own onActivityResult code and encapsulate the complex internal details. ie: the caller’s code: MyIntent i = new MyIntent(); i.getMyData(new OnData() { public void onData(Bundle data) {….} ); I tried creating a “dummy” Activity […]

Supress Android incomming call Activity from apearing

How are things now This has been discussed in many questions but neither one offers a good solution. Things look simple, after having a BroadcastReceiver is really easy to intercept and block a call. The main issue that appears is the default Android incoming call screen. You know, the one with sliders for answer/end call. […]

How to add or remove intent filter programmatically in android?

Is it possible to remove intent filters from activity based on user preference? Say dial intent filter is added and then at later point of time user decides the application should not handle dial. Edit: Removed add part in question description

Passing searching data to Searchable Activity

I have a main activity which has 2 fragments. The main activity has a SearchView in the action bar. Both the fragments have a list of large number of strings, List<String>. The flow is: User enters Fragment I –> Selects a string (lets say Selection1) –> Based on Selection1 a list of strings is populated […]

How to access shared preference between activities in android?

I have two activities A and B. Activity A has a form and by clicking on submit button it saves the form data into shared preference. Activity B has to retrieve data from the shared preferences saved by activity A. I went through so many forums and got suggestion to uses getSharedPreference(Filename,Mode) instead of getPreference(Mode). […]

How to use Native Activity? Can it be combined with traditional activity?

I have two libraries (.so), which I load in java code. However there are a few specific operations which require Java(Activity)<->C++(.so files) calls. Can I use Native Activity to implement part of those functionalities? Is native activity something which is additional to traditional activity or do I have to choose, which type of activity I […]

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