[android] sendUserActionEvent() is null

I've got a real doozy here. When I click on spinners, open menu items, or open context menus on long-clicks I get the same Logcat message:

08-02 21:20:57.264: E/ViewRootImpl(31835): sendUserActionEvent() mView == null

The tag is ViewRootImpl, and the message is sendUserActionEvent() mView == null. I could not find anything helpful about this on the web. I searched through the Android sources and found some references to mView, but I could not find the file in which this log message is printed. For reference, I'm using a Samsung Galaxy S4 running 4.2.2, or API 17. The same message does NOT occur when debugging on a Nexus 7 running Android 4.3. Any ideas? Is this a Samsung-specific issue?

This question is related to android android-view logcat samsung-mobile

The answer is


Even i face similar problem after I did some modification in code related to Cursor.

public boolean onContextItemSelected(MenuItem item) 
{
        AdapterContextMenuInfo info = (AdapterContextMenuInfo)item.getMenuInfo();
        Cursor c = (Cursor)adapter.getItem(info.position);
        long id = c.getLong(...);
        String tempCity = c.getString(...);
            //c.close();
...
}

After i commented out //c.close(); It is working fine. Try out at your end and update Initial setup is as... I have a list view in Fragment, and trying to delete and item from list via contextMenu.


Same issue on a Galaxy Tab and on a Xperia S, after uninstall and install again it seems that disappear.

The code that suddenly appear to raise this problem is this:

public void unlockMainActivity() {
    SharedPreferences prefs = getSharedPreferences("CALCULATOR_PREFS", 0);
    boolean hasCode = prefs.getBoolean("HAS_CODE", false);
    Context context = this.getApplicationContext();
    Intent intent = null;

    if (!hasCode) {
        intent = new Intent(context, WellcomeActivity.class);
    } else {
        intent = new Intent(context, CalculatingActivity.class);
    }
    intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
    (context).startActivity(intent);
}

It is an error on all Samsung devices, the solution is: put this line in your activity declaration in Manifest.

android:configChanges="orientation|screenSize"

also when you start the activity you should do this:

Intent intent = new Intent(CurrentActivity.this, NextActivity.class);
intent.setType(Settings.ACTION_SYNC_SETTINGS);
CurrentActivity.this.startActivity(intent);
finish();

I used this to make an activity as fullscreen mode, but this question does not need the fullscreen code, but in all cases might someone need it you can refer to this question for the rest of the code:

How to make VideoView full screen


This has to do with having two buttons with the same ID in two different Activities, sometimes Android Studio can't find, You just have to give your button a new ID and re Build the Project


I solved this problem on my Galaxy S4 phone by replacing context.startActivity(addAccountIntent); with startActivity(new Intent(Settings.ACTION_ADD_ACCOUNT));


Examples related to android

Under what circumstances can I call findViewById with an Options Menu / Action Bar item? How to implement a simple scenario the OO way My eclipse won't open, i download the bundle pack it keeps saying error log getting " (1) no such column: _id10 " error java doesn't run if structure inside of onclick listener Cannot retrieve string(s) from preferences (settings) strange error in my Animation Drawable how to put image in a bundle and pass it to another activity FragmentActivity to Fragment A failure occurred while executing com.android.build.gradle.internal.tasks

Examples related to android-view

No resource identifier found for attribute '...' in package 'com.app....' Is there an addHeaderView equivalent for RecyclerView? Coloring Buttons in Android with Material Design and AppCompat How to make a view with rounded corners? android - listview get item view by position How to programmatically round corners and set random background colors sendUserActionEvent() is null How to view method information in Android Studio? Android basics: running code in the UI thread Android view pager with page indicator

Examples related to logcat

strange error in my Animation Drawable Android Studio - ADB Error - "...device unauthorized. Please check the confirmation dialog on your device." Couldn't load memtrack module Logcat Error sendUserActionEvent() is null Android studio logcat nothing to show Restore LogCat window within Android Studio error opening trace file: No such file or directory (2) Android Log.v(), Log.d(), Log.i(), Log.w(), Log.e() - When to use each one? How to filter Android logcat by application? Filter output in logcat by tagname

Examples related to samsung-mobile

Hide "NFC Tag type not supported" error on Samsung Galaxy devices Chrome's remote debugging (USB debugging) not working for Samsung Galaxy S3 running android 4.3 sendUserActionEvent() is null Turn ON/OFF Camera LED/flash light in Samsung Galaxy Ace 2.2.1 & Galaxy Tab