Tag: android-activity

Fastest way to create a mock Activity for testing

I’m currently unit-testing a library. In certain classes, I need to pass an activity as parameter in some static methods. The library itself contains no activities. I need to somehow obtain an instance of a mock activity to use in each individual method test. I’ve already read the Activity Testing Tutorial and the Testing Fundamentals […]

Decoupling In-App-Billing from Activity

All tutorials I could find on Android In-App-Billing V3 assume you have one single activity that handles everything billing related. In my case there are multiple activities which will need access to the billing. How would I handle such a thing most elegantly? One example problem I stumbled upon: When working with the Google billing […]

LeftNavBar creates black bar at the top of the activity

I’m trying to incorporate Google’s LeftNavBarLibrary into my application. When I load the nav bar I end up with a black bar across the top of the activity. The bar appears to be taking up the space a traditional actionbar would occupy. Does anyone know where the bar is coming from or how to remove […]

Android drag and return to previous activity like Facebook and Google Photos

I have been finding a way to implement animation like Facebook and Google Photos. When in 2nd Activity, when dragging images the images follow and the 2nd Activity started to fade out and we see 1st Activity. Images of what I was trying to ask is here.

How to remove singleTask activity with taskAffinity from recent tasks when it is finished?

Let assume we have two activities. A – main activity, that is “home launcher enabled” (proper intent filters etc.) B – task root activity with singleTask specification (there can be only one instance of this activity) and with custom taskAffinity (to differentiate if from the main task root). Let assume that B represents a task, […]

Efficiently Passing Custom Object Data between Android Activities

I’ve been stumped with this for a while now. I’m working on an android app that stores a person’s fish catches, favorite fishing locations, tackle box inventory and other data. All my classes are Serializable and can saved and loaded between activities which seems to work thus far. But I’m predicting as more and more […]

Detailed android activity lifecycle (onAttachedToWindow())

I’m interested in android activity lifecycle and I would like to get more detailed description/documentation/reference than widely available basic (onCreate->onStart->onResume) one. My need comes from realizing that starting new activity (Theme.Dialog styled) from onAttachedToWindow() greatly improves response time if comparing to starting it from onCreate(). I wonder how this onAttachedToWindow() fits into whole android activity […]

Android deep linking – Back stack

I am trying to implement deep linking in my Android application. I have been following this guide. I have an Android Activity that is started from and intent-filter in the Android manifest: <activity android:name=”.MyActivity” android:parentActivityName=”.MainActivity” > <intent-filter android:label=”@string/filter_title_deep_link”> <action android:name=”android.intent.action.VIEW” /> <category android:name=”android.intent.category.DEFAULT” /> <category android:name=”android.intent.category.BROWSABLE” /> <data android:scheme=”com.example” /> </intent-filter> <meta-data android:name=”android.support.PARENT_ACTIVITY” android:value=”.MainActivity”/> </activity> […]

Android: Why shouldn't I use activities inside tabs?

I’ve read at a few places that I should not be using Activities as contents of my tabs. I would like to know why this is not a recommended approach… Any suggestions?

Fragment and parent activity life cycle together

I was following these four topics Creating a Fragment, Handling the Fragment Lifecycle , Managing the Activity Lifecycle and Pausing and Resuming an Activity. So I am in a little doubt about this. My question is If A Activity call B Activity through Intent but A does not call finish() method then A will be […]

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