Android user level error (I think)

Over the past 2 months, I went back from Eclipse to Android Studio and vice versa to fix this error.

So while I am testing it on Motorola E 4G LTE no error appears.

But when I test it on my Samsung Galaxy S3, the error appears no matter what.

My app is a test app that has all the functionality in MainActivity

. I'll link to the main action and the error I'm getting in the LogCat. If any other information is needed please let me know.

MainActivity:

public class MainActivity extends Activity {

    TextView tv;
    Button btn;
    LinearLayout ll;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        ll = (LinearLayout) findViewById(R.id.ll);

        tv = new TextView(this);
        btn = new Button(this);
        btn.setText("Press here");
        btn.setVisibility(View.VISIBLE);



        ll.addView(btn);

    }

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

        btn.setOnClickListener(new View.OnClickListener(){
            @Override
            public void onClick(View v) {

                tv.setText("works");
                tv.setVisibility(View.VISIBLE);

                ll.addView(tv);

            }
        });

    }
}

      

LogCat error:

07-17 21:25:12.909: E/DatabaseUtils(2344): Writing exception to parcel
07-17 21:25:12.909: E/DatabaseUtils(2344): 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
07-17 21:25:12.909: E/DatabaseUtils(2344):  at com.android.server.am.ActivityManagerService.handleIncomingUser(ActivityManagerService.java:13140)
07-17 21:25:12.909: E/DatabaseUtils(2344):  at android.app.ActivityManager.handleIncomingUser(ActivityManager.java:2038)
07-17 21:25:12.909: E/DatabaseUtils(2344):  at com.android.providers.settings.SettingsProvider.callFromPackage(SettingsProvider.java:607)
07-17 21:25:12.909: E/DatabaseUtils(2344):  at android.content.ContentProvider$Transport.call(ContentProvider.java:279)
07-17 21:25:12.909: E/DatabaseUtils(2344):  at android.content.ContentProviderNative.onTransact(ContentProviderNative.java:273)
07-17 21:25:12.909: E/DatabaseUtils(2344):  at android.os.Binder.execTransact(Binder.java:388)
07-17 21:25:12.909: E/DatabaseUtils(2344):  at dalvik.system.NativeStart.run(Native Method)

      

IMPORTANT: The error occurs when I press the button. But it works, the application does not crash, although the error is there. Also, I first got this error in an application I am developing when I was trying to create a UDP connection. After that, every click or click was causing an error in the project ...

Any suggestions other than what you can find with an obvious google search and by reading the Android documentation is more than welcome ...

Just for the record, I'm working with Android studio.

When I try to add it, it won't show me the INTERACT_ACROSS_USERS_FULL ...

+3


source to share


1 answer


So ... for those who had the same problem, the answer is not what I expected, but it seems to be the correct answer.

It looks like my Samsung Galaxy S3 is to blame for the error right now.

Tested both the app I'm working on and the test app on my Samsung and my Motorola. Motorola does not throw any errors, while Samsung does.



The only problem is that Motorola got the same error before I do a fresh reinstallation of AS.

I'll consider this as the correct answer at the moment, but if things change and I run into the problem again, I'll come back with fresh information.

Thanks for the help to those who answered.

0


source







All Articles