0

I have an android app where the users click a button and the and fires events like this:

img.top(); //Images img; it's another class

   currentTop = img.getcTop(); // a method in the other class
   TopBorder.setImageBitmap(currentTop); //top border is an imageview 

where that img is Images img; global variable for another class and the bitmap currentTop takes the current img from the other class

    public void top(){
    topColor++; //global int for switching images
            //using switch for adding more in future
    if(topColor>2){
        topColor = 1;
    }
    switch(topColor){
    case 1:
        cTop = topblue;

        break;
    case 2:
        cTop = topred;

        break;
    }
}

where's the cTop stand for other images , I used decodestream for defining other images like this

InputStream istb = getResources().openRawResource(R.drawable.borderbluet);
    topblue  = BitmapFactory.decodeStream(istb);

the logcat says

01-08 15:10:18.851: E/DatabaseUtils(2953): Writing exception to parcel
01-08 15:10:18.851: E/DatabaseUtils(2953): java.lang.SecurityException: Permission Denial: get/set setting for user asks to run as user -2 but is calling from user 0; this requires android.permission.INTERACT_ACROSS_USERS_FULL
01-08 15:10:18.851: E/DatabaseUtils(2953):  at com.android.server.am.ActivityManagerService.handleIncomingUser(ActivityManagerService.java:13082)
01-08 15:10:18.851: E/DatabaseUtils(2953):  at android.app.ActivityManager.handleIncomingUser(ActivityManager.java:2038)
01-08 15:10:18.851: E/DatabaseUtils(2953):  at com.android.providers.settings.SettingsProvider.callFromPackage(SettingsProvider.java:577)
01-08 15:10:18.851: E/DatabaseUtils(2953):  at android.content.ContentProvider$Transport.call(ContentProvider.java:279)
01-08 15:10:18.851: E/DatabaseUtils(2953):  at android.content.ContentProviderNative.onTransact(ContentProviderNative.java:273)
01-08 15:10:18.851: E/DatabaseUtils(2953):  at android.os.Binder.execTransact(Binder.java:388)
01-08 15:10:18.851: E/DatabaseUtils(2953):  at dalvik.system.NativeStart.run(Native Method)

The bitmaps are not static and the getters either. The app was working fine when I was declaring them all in one class. But I don't want to make the class have too many methods to allow easy modification in the future.

Any help will be appreciated Thank you.

0 Answers0