Dex cache issue

by nickname » Fri, 23 Apr 2010 08:05:15 GMT


Sponsored Links
 i all,
My application is crashing once in a while . Logcat logs are pasted
bellow.

04-11 02:26:37.225 1245 1245 W dalvikvm: Refusing to reopen boot DEX '/
system/framework/frameworks.jar'
04-11 02:26:37.334 1245 1245 E dalvikvm: Can't open dex cache '/data/
dalvik-cache/sys...@app@settings....@classes.dex': No such file or
directory
04-11 02:26:37.345 1245 1245 I dalvikvm: Unable to open or create
cache for /system/app/Settings.apk (/data/dalvik-cache/
sys...@app@settings....@classes.dex)
04-11 02:26:37.350 1245 1245 D AndroidRuntime: Shutting down VM
04-11 02:26:37.373 1245 1245 W dalvikvm: threadid=3: thread exiting
with uncaught exception (group=0x4001e600)
04-11 02:26:37.373 1245 1245 E AndroidRuntime: Uncaught handler:
thread main exiting due to uncaught exception
04-11 02:26:37.389 1245 1245 E AndroidRuntime:
java.lang.RuntimeException: Unable to start activity
ComponentInfo{com.android.setupwizard/
com.android.setupwizard.SetupWirelessActivity}:
java.lang.RuntimeException: Unable to instantiate activity
ComponentInfo{com.android.settings/
com.android.settings.wifi.WifiSettings}:
java.lang.ClassNotFoundException:
com.android.settings.wifi.WifiSettings in loader
dalvik.system.pathclassloa...@44f0d8d8
04-11 02:26:37.389 1245 1245 E AndroidRuntime: at
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:
2550)
04-11 02:26:37.389 1245 1245 E AndroidRuntime: at
android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:
2566)
04-11 02:26:37.389 1245 1245 E AndroidRuntime: at
android.app.ActivityThread.access$2400(ActivityThread.java:121)
04-11 02:26:37.389 1245 1245 E AndroidRuntime: at
android.app.ActivityThread$H.handleMessage(ActivityThread.java:1917)
04-11 02:26:37.389 1245 1245 E AndroidRuntime: at
android.os.Handler.dispatchMessage(Handler.java:99)
04-11 02:26:37.389 1245 1245 E AndroidRuntime: at
android.os.Looper.loop(Looper.java:123)
04-11 02:26:37.389 1245 1245 E AndroidRuntime: at
android.app.ActivityThread.main(ActivityThread.java:4417)
04-11 02:26:37.389 1245 1245 E AndroidRuntime: at
java.lang.reflect.Method.invokeNative(Native Method)
04-11 02:26:37.389 1245 1245 E AndroidRuntime: at
java.lang.reflect.Method.invoke(Method.java:521)
04-11 02:26:37.389 1245 1245 E AndroidRuntime: at
com.android.internal.os.ZygoteInit
$MethodAndArgsCaller.run(ZygoteInit.java:860)
04-11 02:26:37.389 1245 1245 E AndroidRuntime: at
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)
04-11 02:26:37.389 1245 1245 E AndroidRuntime: at
dalvik.system.NativeStart.main(Native Method)
04-11 02:26:37.389 1245 1245 E AndroidRuntime: Caused by:
java.lang.RuntimeException: Unable to instantiate activity
ComponentInfo{com.android.settings/
com.android.settings.wifi.WifiSettings}:
java.lang.ClassNotFoundException:
com.android.settings.wifi.WifiSettings in loader
dalvik.system.pathclassloa...@44f0d8d8
04-11 02:26:37.389 1245 1245 E AndroidRuntime: at
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:
2471)
04-11 02:26:37.389 1245 1245 E AndroidRuntime: at
android.app.ActivityThread.startActivityNow(ActivityThread.java:2389)
04-11 02:26:37.389 1245 1245 E AndroidRuntime: at
android.app.LocalActivityManager.moveToState(LocalActivityManager.java:
127)
04-11 02:26:37.389 1245 1245 E AndroidRuntime: at
android.app.LocalActivityManager.startActivity(LocalActivityManager.java:
339)
04-11 02:26:37.389 1245 1245 E AndroidRuntime: at
com.an



Other Threads

1. startActivityForResult and setResult problems

ok I have two classes my main class calls a menu class when the user
gets done with that they press the back button to go to the main
class. on the main class I have onActivityResult setup but no matter
what the data field is null all the time even though I setup the
bundle and attached it to an Intent. Please look over my code and see
what it going on.

Main class

import android.app.Activity;
import android.os.Bundle;
import android.content.Intent;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import android.view.View;

public class caralarm extends Activity {



        /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);


    @Override
        public boolean onCreateOptionsMenu(Menu menu) {
        new MenuInflater(this).inflate(R.menu.menu, menu);
        return(super.onCreateOptionsMenu(menu));
        }


    @Override
        public boolean onOptionsItemSelected(MenuItem item) {

    if (item.getItemId()==R.id.close) {
        Toast.makeText(this, "Trying to close app",
Toast.LENGTH_SHORT).show();
    }

    if (item.getItemId()==R.id.refresh) {
        Toast.makeText(this, "Trying to refresh app",
Toast.LENGTH_SHORT).show();
    }

    if (item.getItemId()==R.id.settings) {
        Toast.makeText(this, "Trying to open settings app",
Toast.LENGTH_SHORT).show();
        launch_settings2();



    }

    return(super.onOptionsItemSelected(item));
    }

 protected void onActivityResult(int requestCode, int resultCode,
            Intent data){



        if (data == null)
        {
                Log.d ("data", "data was null");
                Number = Settings2.Number; //this works
                Password = Settings2.Passwordtext;
                Often = Settings2.NumMin;
                return;

        }

        Bundle extras = data.getExtras();
        String name = extras.getString("Alarm");
        Toast.makeText(this, name, Toast.LENGTH_SHORT);

}

    void launch_settings2(){
          Intent i = new Intent(this, Settings2.class);
          startActivityForResult(i, 0);

  }
}

Settings2 class
Import android.preference.Preference;
import android.preference.PreferenceActivity;
import android.preference.PreferenceManager;
import android.widget.EditText;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.os.Bundle;

public class Settings2 extends PreferenceActivity{
        static String Number = "";
        static String Passwordtext = "";
        static String NumMin = "";

protected void onCreate (Bundle savedInstanceState){
        super.onCreate(savedInstanceState);
        addPreferencesFromResource(R.xml.settings2);
}

public static String getNumber (Context context){

        return
PreferenceManager.getDefaultSharedPreferences(context).getString("AlarmNumber",
Number);
        }

public static String getPassword (Context context){

        return
PreferenceManager.getDefaultSharedPreferences(context).getString("Password",
Passwordtext);
        }

public static String getNumMin (Context context){

        return
PreferenceManager.getDefaultSharedPreferences(context).getString("Often",
NumMin);
        }

@Override
protected void onPause(){
        super.onPause();


//copy data
Number = getNumber(this);
Passwordtext = getPassword(this);
NumMin = getNumMin(this);

Bundle info = new Bundle();
info.putString("Alarm", Number );
info.putString("Password", Passwordtext);
info.putString("Often", NumMin);
Intent intent = new Intent();
intent.putExtras(info);


setResult(RESULT_OK, intent);
finish();



}
}



-- 

2. Launch Google Maps app

Hi,
I'm trying to launch Google maps from my application.
I'm using:

GeoPoint center = _mapView.getMapCenter();
Uri uri = Uri.parse("geo:"+center.getLatitudeE6()
+","+center.getLongitudeE6());
Log.d(LOG_TAG, "Launching Google Maps with Uri: ("+uri+")");
Intent intent = new Intent(Intent.ACTION_VIEW, uri);
startActivity(intent);


I tested it with a map centered on somewhere in NYC, however Google
maps opens not centered there.
I followed Android Developer's site reference to use:
"geo:latitude,longitude" pattern.

the log that you see prints:
03-31 13:01:20.126: DEBUG/CarMapActivity(248): Launching Google Maps
with Uri: (geo:40763500,-73979305)

anyone knows what can be the problem?

thanks!

-- 

3. Touchscreen support for 7 Inch LCD panel

4. finish parent activity from child

5. Harga milestones di malaysia :)

6. List providers - does it work for Android 1.5?

7. Unit-testing framework snippet