Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

When does this occur? and Why? Android App Activity being shutdown 2.3.3 emulator with error

Tags:

android

08-16 17:37:37.694: ERROR/InputDispatcher(61): channel '40803d28 com.myApp.android/com.myApp.android.PickActivity (server)' ~ Consumer closed input channel or an error occurred.  events=0x8
08-16 17:37:37.694: ERROR/InputDispatcher(61): channel '40803d28 com.myApp.android/com.myApp.android.PickActivity (server)' ~ Channel is unrecoverably broken and will be disposed!

Sometimes I also see this message.

08-16 17:44:21.092: ERROR/InputDispatcher(61): Received spurious receive callback for unknown input channel.  fd=177, events=0x8

So this only only happens in 2.3.3 emulator and not on 3.0 or 2.2 or any other emulators I have tested on and even works great on my Froyo Droid Incredible real device. No errors nothing.

Whenever I open the App's main Activity in 2.3.3 emulator, after a little bit like 5-7 secs invariably I see the log message above and the activity closes down. I am not sure what this means. I have never seen this before.

Here are some code snippets of the activity. This is the main activity of the App that is displayed to the user when logged in to the App and then they can choose from 4 icons that launches their respective activities.

Also I guess worth mentioning is that this Activity has a MillenialMedia Banner Ad bottom that once again fetched Ads and works fine in all other emulators and devices.

public class PickActivity extends Activity implements OnClickListener, MMAdListener{

@Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
                getWindow().setFormat(PixelFormat.RGBA_8888);
        setContentView(R.layout.main);
        // Instantiate shared preferences
        mAppPreferences = PreferenceManager.getDefaultSharedPreferences(this);
        mEditor = mAppPreferences.edit();
        // Instantiate the views
        setupViews();
        Hashtable<String, String> map = new Hashtable<String, String>();
        map.put("keywords", "shopping,deals,money,coupons,sports");
        //include additional metadata or settings in the hashmap

        MMAdView adView = new MMAdView(this, MYAPID, MMAdView.BANNER_AD_BOTTOM, 30, map);
        adView.setId(123);
        FrameLayout adFrameLayout = (FrameLayout)findViewById(R.id.mm_layout);
        LayoutParams lp = new LayoutParams(LayoutParams.FILL_PARENT,LayoutParams.WRAP_CONTENT);
        adFrameLayout.addView(adView, lp); 

}

Then I have implemented onStart, onStop and onResume.

Here is the setupViews method

private void setupViews() {

        yourA = (ImageButton)findViewById(R.id.MA);
        yourA.setOnClickListener(this);
        yourC = (ImageButton)findViewById(R.id.MC);
        yourC.setOnClickListener(this);
        yourM = (ImageButton)findViewById(R.id.MM);
        yourM.setOnClickListener(this);
        yourS = (ImageButton)findViewById(R.id.MS);
        yourS.setOnClickListener(this);
        //Action bar Help button
        helpButton = (ImageButton)findViewById(R.id.ActionHelpButton);
        helpButton.setOnClickListener(this);
        // Action bar Video button
        videoButton = (ImageButton)findViewById(R.id.ActionVideoButton);
        videoButton.setVisibility(View.VISIBLE);
        videoButton.setOnClickListener(this);
        // Footer marquee TextView
        footerText = (TextView) findViewById(R.id.FooterMarquee);         
    }

I have also added the MMAdListener default methods in the class with Log messages.

Please help me find out why this is happening only in 2.3.3 emulator and activity is shut down.

Thanks for your help.

like image 646
Aakash Avatar asked Nov 13 '22 18:11

Aakash


1 Answers

I had the same error. My app is calling a REST service so adding

<uses-permission android:name="android.permission.INTERNET"></uses-permission>

to the android manifest fixed the issue for me.

like image 191
Eivind Avatar answered Jan 17 '23 02:01

Eivind