Tag: android-activity

Android Activity Transition Animation

What I am trying to achieve is : start a new activity with a transition animation for the exiting activity only. I would like to slide up the current activity, where the new activity will be behind the current one. Here is the slide up animation : R.layout.slide_up <set xmlns:android=”http://schemas.android.com/apk/res/android”> <translate android:duration=”1000″ android:fromYDelta=”0%” android:toYDelta=”100%” /> […]

Espresso how to test if Activity is finished?

I want to assert that my Acitivty that I am currently testing is finished when certain actions are performed. Unfortunately so far I am only to assert it by adding some sleep at the end of the test. Is there a better way ? import android.content.Context; import android.os.Build; import android.support.test.rule.ActivityTestRule; import android.test.suitebuilder.annotation.LargeTest; import org.junit.Before; import […]

Android: Use icon as back button without reloading previous activity

I have the following code to enable to home button to act as a back button. The problem I’m facing is from this activity if I use the real back button it simply goes back to the previous activity just as I left it. If I use the home button it’s reloading the page so […]

Android Activity restarts after Unlocking device

I am creating a simple Android project. But my every activity gets Restart when user unlock the screen(after locking). Is it normal behavior of android app? OR i have to handle it in Manifest? or some where else? Please Help…

Android Galaxy S4 — Activity that is visible over lock screen

A few years ago, I wrote an alarm app that worked on Android 2, and I’m now trying to upgrade it to work on Android 4. Specifically, on the Samsung Galaxy S4. On Android 2, if the phone was sleeping, it would wake the phone up and display a “Snooze or Dismiss” screen over the […]

how to kill sub activities and bring activity to top of stack

I have activity A that starts activity B which starts activity C A -> B -> C When a user clicks on a button in activity C, i want to bring A to the top of the stack and take B & C completely out of the stack. Is there a way to do this […]

Go back to a specific activity

Here’s what I want to do: If I use startActivity I start a new Activity and I can’t use StartActivityForResult from Main Menu -> Total. I would like to go back on the Main Menu activity already present in my stack and remove Activities A, B ,C and Total.

How to make background Activity smaller while opening the Navigation Drawer?

I want to make my background Activity a little bit smaller while opening the Navigation Drawer, Simulate the effect that exists in the Airbnb application. I guess the best explanation would be a screenshot: But the point is not to make the View just smaller, but to make it an animation that is synchronized to […]

Removing an entry from an Bundle (i.e. extras) doesn't seem to work in combination with the back button

I have a BroadcastReceiver that listen to incoming SMS’. If the message is from a certain sender, the BroadcastReceiver starts my app with the following code: final Intent activityIntent = new Intent(context, MainActivity.class); activityIntent.putExtra(“smsChallenge”, smsText); activityIntent.putExtra(“smsSenderNumber”, senderMobilNumber); activityIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); activityIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); context.startActivity(activityIntent); In the MainActivity of my app (i.e. in onCreate()), I extract the value smsChallenge out […]

Activity side-by-side lifecycle

Imagine that I have an Activity A and I’m starting a new activity B from that one. What will be the Activities lifecycle side-by-side? 1. A: onCreate 2. A: onStart 3. A: onResume on A => startActivity(B) 4. B: onCreate 5. B: onStart 6. A: onPause 7. B: onResume 8. A: onStop Is this correct?

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