For the past 2 months, I went back on forth with from Eclipse to Android Studio and the other way around to try and fix this error.
So, while I test it on a Motorola E 4G LTE, the error won't show up.
But when I test it on my Samsung Galaxy S3, the error shows up no matter what.
My application is a test application, which has every functionality in the MainActivity
. I will link the main activity and the error which I get in LogCat. If any other information is needed, 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 app does not crash, although, the error is there. Also, I firstly got this error in the application I am developing when I was trying to make an UDP connection.After that, every touch or click was triggering the error in the project...
Any suggestions besides what you can find with an obvious google search and by reading android documentation is more than welcome...
Just for the record, I am working with Android studio.