How can I play a custom animation between 2 activity?

by Dianne Hackborn » Thu, 12 Mar 2009 02:10:55 GMT


Sponsored Links
 Transition animations are not enabled by default in current Android.  You
must have turned it on somehow in your emulator.






-- 
Dianne Hackborn
Android framework engineer
hack...@android.com

Note: please don't send private questions to me, as I don't have time to
provide private support.  All such questions should be posted on public
forums, where I and others can see and answer them.

--~--~---------~--~----~------------~-------~--~----~



Other Threads

1. recording audio, getting null pointer error in contentresolver.insert

I am trying out the basic functions of recording audio and I'm trying
to get a URI to store the audio at - when I run it, it gets to the
contentresolver.insert line and throws an exception.  The LogCat
output is below.  Does anyone have any idea what I'm doing wrong
here?  Thanks.

Code:
---------------
recorder = new MediaRecorder();
ContentValues values = new ContentValues(1);

values.put(MediaStore.MediaColumns.TITLE, "testfile");

//get a pointer to the system-wide contentresolver
ContentResolver contentResolver;
contentResolver = getApplicationContext().getContentResolver();

Uri newUri= null;
Uri base = null;
base = MediaStore.Audio.Media.INTERNAL_CONTENT_URI;
try{
newUri = contentResolver.insert(base, values);
}
catch(Exception e){
e.printStackTrace();
}
----------------------------------------------------------
End of code


LogCat:
--------------------------
12-05 14:15:22.585: INFO/System.out(247): de{*filter*} has settled (1355)
12-05 14:15:37.353: DEBUG/dalvikvm(60): threadid=15: bogus mon 1+0>0;
adjusting
12-05 14:15:44.634: INFO/ActivityManager(60): Displayed activity
hello.there/.sayhi: 51353 ms (total 51353 ms)
12-05 14:17:04.543: ERROR/DatabaseUtils(187): Writing exception to
parcel
12-05 14:17:04.543: ERROR/DatabaseUtils(187):
java.lang.NullPointerException
12-05 14:17:04.543: ERROR/DatabaseUtils(187):     at
com.android.providers.media.MediaProvider.insertInternal
(MediaProvider.java:1478)
12-05 14:17:04.543: ERROR/DatabaseUtils(187):     at
com.android.providers.media.MediaProvider.insert(MediaProvider.java:
1370)
12-05 14:17:04.543: ERROR/DatabaseUtils(187):     at
android.content.ContentProvider$Transport.insert(ContentProvider.java:
150)
12-05 14:17:04.543: ERROR/DatabaseUtils(187):     at
android.content.ContentProviderNative.onTransact
(ContentProviderNative.java:140)
12-05 14:17:04.543: ERROR/DatabaseUtils(187):     at
android.os.Binder.execTransact(Binder.java:287)
12-05 14:17:04.543: ERROR/DatabaseUtils(187):     at
dalvik.system.NativeStart.run(Native Method)
12-05 14:17:05.473: WARN/System.err(247):
java.lang.NullPointerException
12-05 14:17:05.843: WARN/System.err(247):     at
android.os.Parcel.readException(Parcel.java:1224)
12-05 14:17:05.975: WARN/System.err(247):     at
android.database.DatabaseUtils.readExceptionFromParcel
(DatabaseUtils.java:160)
12-05 14:17:06.073: WARN/System.err(247):     at
android.database.DatabaseUtils.readExceptionFromParcel
(DatabaseUtils.java:114)
12-05 14:17:06.083: WARN/System.err(247):     at
android.content.ContentProviderProxy.insert(ContentProviderNative.java:
445)
12-05 14:17:06.124: WARN/System.err(247):     at
android.content.ContentResolver.insert(ContentResolver.java:629)
12-05 14:17:06.460: WARN/System.err(247):     at hello.there.sayhi
$2.onClick(sayhi.java:77)
12-05 14:17:06.569: WARN/System.err(247):     at
android.view.View.performClick(View.java:2364)
12-05 14:17:06.774: WARN/System.err(247):     at
android.view.View.onTouchEvent(View.java:4179)
12-05 14:17:06.890: WARN/System.err(247):     at
android.widget.TextView.onTouchEvent(TextView.java:6532)
12-05 14:17:07.005: WARN/System.err(247):     at
android.view.View.dispatchTouchEvent(View.java:3709)
12-05 14:17:07.134: WARN/System.err(247):     at
android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:882)
12-05 14:17:07.334: WARN/System.err(247):     at
android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:882)
12-05 14:17:07.414: WARN/System.err(247):     at
android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:882)
12-05 14:17:07.683: WARN/System.err(247):     at
android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:882)
12-05 14:17:07.850: WARN/System.err(247):     at
com.android.internal.policy.impl.PhoneWindow
$DecorView.superDispatchTouchEvent(PhoneWindow.java:1659)
12-05 14:17:08.110: WARN/System.err(247):     at
com.android.internal.policy.impl.PhoneWindow.superDispatchTouchEvent
(PhoneWindow.java:1107)
12-05 14:17:08.263: WARN/System.err(247):     at
android.app.Activity.dispatchTouchEvent(Activity.java:2061)
12-05 14:17:08.334: WARN/System.err(247):     at
com.android.internal.policy.impl.PhoneWindow
$DecorView.dispatchTouchEvent(PhoneWindow.java:1643)
12-05 14:17:08.383: WARN/System.err(247):     at
android.view.ViewRoot.handleMessage(ViewRoot.java:1690)
12-05 14:17:08.574: WARN/System.err(247):     at
android.os.Handler.dispatchMessage(Handler.java:99)
12-05 14:17:08.595: WARN/System.err(247):     at android.os.Looper.loop
(Looper.java:123)
12-05 14:17:08.963: WARN/System.err(247):     at
android.app.ActivityThread.main(ActivityThread.java:4310)
12-05 14:17:08.996: WARN/System.err(247):     at
java.lang.reflect.Method.invokeNative(Native Method)
12-05 14:17:09.255: WARN/System.err(247):     at
java.lang.reflect.Method.invoke(Method.java:521)
12-05 14:17:09.399: WARN/System.err(247):     at
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run
(ZygoteInit.java:860)
12-05 14:17:09.495: WARN/System.err(247):     at
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)
12-05 14:17:09.533: WARN/System.err(247):     at
dalvik.system.NativeStart.main(Native Method)
12-05 14:19:27.225: WARN/jdwp(247): De{*filter*} is telling the VM to exit
with code=1
12-05 14:19:27.403: INFO/dalvikvm(247): GC lifetime allocation: 2511
bytes
12-05 14:19:29.341: INFO/ActivityManager(60): Process hello.there (pid
247) has died.
------------------------------------------------------------------

End of LogCat

-- 

2. Create and write to bitmap (clipping)

I have a game grid.  On any given move there it is possible that any
of several hundred items may move and move multiple times (this is not
a continuous animation,  one move ... results and wait) .  In windows,
I  created a bitmap.  For any move I would restore and draw as
required.  Then when it was done, display the new bitmap on the
screen.  The original was a Windows game.

I think I need to do this for Androd as well.  One problem I had was
memory.  I dont think having hundreds of objects stored in memory
would be good with the available memory in Android.

All the examples I find seem to create a new view, canvas, or bitmap
or whatever for each item.  I have not found the proper example for
what I want.

So if someone has a link or code, I would appreciate seeing an short
sweet example.  Or suggestion.  Im a rookie, so the shorter the
better.

Thanks  ScCrow

-- 

3. How to include widgets in an existing android application

4. How can I change the default color of the Focus Outline for an EditText?

5. Removing Widget from Home Screen when Uninstalled

6. expandable list (urgent)

7. resource id references in XML files?