Problem with continuos animation of children on long press of keys in a Viewgroup.

by ursnavin » Fri, 06 Mar 2009 15:48:29 GMT


Sponsored Links
 Hi all,

Suppose,If the user long presses a key,the animation should run till
the keyup...

For this i tried starting the animation on a new thread with a lock on
a flag variable,till the first animation ends.

Now when the user is still pressing his key,the thread is created with
the nxt animation in it....

On keyup the main thread gets the lock on the flag variable,and relays
the child views in thier new position....

This logic seems to work fine,but after some duration the animation
stops and the application simply hangs,

Is there something that i am missing here.....It would be great if
anyone can tell whether the approach followed is correct or should i
do something else???
--~--~---------~--~----~------------~-------~--~----~



Other Threads

1. Not able to connect device using adb -d shell command from vista

Hello,

I am trying to use "adb -d shell" command to start a shell on device
(android dev 1 phone ) from my vista command line. But whenever I try
giving such command it does not open any shell or interaction on the
phone device. But instead it goes to the next line in the cmd as '$'.
any help would really appreciable.
I have installed adb_usb_windows.

Previously I used work well with the emulator. Using adb command never
troubled me. But now with new device, I am not able to open a shell
using adb -d shell command on the phone.

Thanks in Advance,
adag
--~--~---------~--~----~------------~-------~--~----~

2. Activity launch timeout even with wakelock

Hi,
I have the following code in Oncreate of my activity:

************************************************************************************
   static String linkUrl = "http://www.google.com/";

       protected void onCreate(Bundle savedInstanceState) {
               super.onCreate(savedInstanceState);

               PowerManager pm = (PowerManager) getSystemService
(Context.POWER_SERVICE);
               PowerManager.WakeLock wl = pm.newWakeLock
(PowerManager.SCREEN_DIM_WAKE_LOCK, "My Tag");
               wl.acquire();

       try {
               URL connectURL = new URL(linkUrl);
               HttpURLConnection conn = (HttpURLConnection)
connectURL.openConnection();
               DataInputStream dis = new DataInputStream
(conn.getInputStream
());
               byte[] data = new byte[1024];
               int len = dis.read(data, 0, 1024);
               dataText = new String(data, 0, len);
       }
       catch(Exception e)
       {
           Log.e(TAG, "Exception");
           return;
       }

       TextView bodyText = (EditText) findViewById
(R.id.android_fetchtext);
       bodyText.setText(dataText);
       setContentView(R.layout.notes_fetch);
       wl.release();
       }

************************************************************************************
I declared the following permissions in manifest:
************************************************************************************
   <uses-permission android:name="android.permission.INTERNET" />
   <uses-permission android:name="android.permission.WAKE_LOCK"/>
************************************************************************************
Here is my xml layout file:
************************************************************************************
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/
android"
     android:layout_width="wrap_content"
       android:layout_height="wrap_content">

   <ListView android:id="@+id/android:fetchlist"
         android:layout_width="wrap_content"
               android:layout_height="wrap_content"/>
       <TextView android:id="@+id/android:fetchtext"
         android:layout_width="wrap_content"
               android:layout_height="wrap_content"/>
</LinearLayout>
************************************************************************************

Problem is, application goes to force close with following error:
************************************************************************************
10-19 22:11:49.404: DEBUG/FetchData(715): Entered OnCreate
10-19 22:11:49.413: DEBUG/FetchData(715): Set URL
10-19 22:11:49.435: DEBUG/FetchData(715): HttpURLConnection
10-19 22:11:49.464: DEBUG/FetchData(715): DIS
10-19 22:11:56.013: DEBUG/FetchData(715): Read
--------------------------------
10-19 22:11:59.191: WARN/ActivityManager(574): Launch timeout has
expired, giving up wake lock!
----------------------------------
10-19 22:11:59.307: WARN/ActivityManager(574): Activity idle timeout
for HistoryRecord{438d4478 com.android.demo.notepad3/.FetchData}
-----------------------------------
10-19 22:12:01.455: DEBUG/AndroidRuntime(715): Shutting down VM

10-19 22:12:01.455: WARN/dalvikvm(715): threadid=3: thread exiting
with uncaught exception (group=0x4001aa28)
10-19 22:12:01.465: ERROR/AndroidRuntime(715): Uncaught handler:
thread main exiting due to uncaught exception
10-19 22:12:01.834: ERROR/AndroidRuntime(715):
java.lang.RuntimeException: Unable to start activity ComponentInfo
{com.android.demo.notepad3/com.android.demo.notepad3.FetchData}:
java.lang.NullPointerException
10-19 22:12:01.834: ERROR/AndroidRuntime(715):     at
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:
2401)
10-19 22:12:01.834: ERROR/AndroidRuntime(715):     at
android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:
2417)
10-19 22:12:01.834: ERROR/AndroidRuntime(715):     at
android.app.ActivityThread.access$2100(ActivityThread.java:116)
10-19 22:12:01.834: ERROR/AndroidRuntime(715):     at
android.app.ActivityThread$H.handleMessage(ActivityThread.java:1794)
10-19 22:12:01.834: ERROR/AndroidRuntime(715):     at
android.os.Handler.dispatchMessage(Handler.java:99)
10-19 22:12:01.834: ERROR/AndroidRuntime(715):     at
android.os.Looper.loop(Looper.java:123)
10-19 22:12:01.834: ERROR/AndroidRuntime(715):     at
android.app.ActivityThread.main(ActivityThread.java:4203)
10-19 22:12:01.834: ERROR/AndroidRuntime(715):     at
java.lang.reflect.Method.invokeNative(Native Method)
10-19 22:12:01.834: ERROR/AndroidRuntime(715):     at
java.lang.reflect.Method.invoke(Method.java:521)
10-19 22:12:01.834: ERROR/AndroidRuntime(715):     at
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run
(ZygoteInit.java:791)
10-19 22:12:01.834: ERROR/AndroidRuntime(715):     at
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:549)
10-19 22:12:01.834: ERROR/AndroidRuntime(715):     at
dalvik.system.NativeStart.main(Native Method)
10-19 22:12:01.834: ERROR/AndroidRuntime(715): Caused by:
java.lang.NullPointerException
10-19 22:12:01.834: ERROR/AndroidRuntime(715):     at
com.android.demo.notepad3.FetchData.onCreate(FetchData.java:97)
10-19 22:12:01.834: ERROR/AndroidRuntime(715):     at
android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:
1123)
10-19 22:12:01.834: ERROR/AndroidRuntime(715):     at
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:
2364)
10-19 22:12:01.834: ERROR/AndroidRuntime(715):     ... 11 more
10-19 22:12:02.124: INFO/Process(574): Sending signal. PID: 715 SIG: 3
10-19 22:12:02.134: INFO/dalvikvm(715): threadid=7: reacting to signal
3
10-19 22:12:02.134: ERROR/dalvikvm(715): Unable to open stack trace
file '/data/anr/traces.txt': Permission denied
10-19 22:12:02.675: INFO/ARMAssembler(574): generated
scanline__00000077:03515104_00001001_00000000 [ 64 ipp] (84 ins) at
[0x2447f0:0x244940] in 3552128 ns

************************************************************************************
Any help is deeply appreciated.

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

3. Not able to connect device using adb -d shell command from vista

4. arrays to be accessed by both JAVA n C thru JNI in an Android app

5. (Root) update to rc33

6. Not able to connect device using adb -d shell command from vista

7. Skipping the long load time by having the emulator on all the time