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%” /> […]
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 […]
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 […]
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…
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 […]
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 […]
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.
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 […]
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 […]
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?