Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7948295
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T01:41:05+00:00 2026-06-04T01:41:05+00:00

I have been trying to get this android service working but I can not

  • 0

I have been trying to get this android service working but I can not figure out why I am getting this error.

05-13 12:13:36.203: ERROR/dalvikvm(7782): could not disable core file generation for   pid 7782: Operation not permitted
05-13 12:13:36.469: ERROR/AndroidRuntime(7782): FATAL EXCEPTION: main
05-13 12:13:36.469: ERROR/AndroidRuntime(7782): java.lang.ClassCastException: android.os.BinderProxy
05-13 12:13:36.469: ERROR/AndroidRuntime(7782):     at whiskeymedia.com.GiantBombAppActivity$1.onServiceConnected(GiantBombAppActivity.java:69)
05-13 12:13:36.469: ERROR/AndroidRuntime(7782):     at android.app.LoadedApk$ServiceDispatcher.doConnected(LoadedApk.java:1064)
05-13 12:13:36.469: ERROR/AndroidRuntime(7782):     at android.app.LoadedApk$ServiceDispatcher$RunConnection.run(LoadedApk.java:1081)
05-13 12:13:36.469: ERROR/AndroidRuntime(7782):     at android.os.Handler.handleCallback(Handler.java:587)
05-13 12:13:36.469: ERROR/AndroidRuntime(7782):     at android.os.Handler.dispatchMessage(Handler.java:92)
05-13 12:13:36.469: ERROR/AndroidRuntime(7782):     at android.os.Looper.loop(Looper.java:130)
05-13 12:13:36.469: ERROR/AndroidRuntime(7782):     at android.app.ActivityThread.main(ActivityThread.java:3806)
05-13 12:13:36.469: ERROR/AndroidRuntime(7782):     at java.lang.reflect.Method.invokeNative(Native Method)
05-13 12:13:36.469: ERROR/AndroidRuntime(7782):     at java.lang.reflect.Method.invoke(Method.java:507)
05-13 12:13:36.469: ERROR/AndroidRuntime(7782):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
05-13 12:13:36.469: ERROR/AndroidRuntime(7782):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
05-13 12:13:36.469: ERROR/AndroidRuntime(7782):     at dalvik.system.NativeStart.main(Native Method)
05-13 12:13:45.234: ERROR/GlobalUnplugService(7116): plugged = true,mBatteryPlugged=true

GiantBombAppActivity:

package whiskeymedia.com;

import java.util.ArrayList;
import java.util.List;

import whiskeymedia.com.vo.Achievement;
import android.app.ListActivity;
import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
import android.content.ServiceConnection;
import android.graphics.Color;
import android.os.Bundle;
import android.os.IBinder;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.ArrayAdapter;
import android.widget.ListView;
import android.widget.TextView;
import android.widget.Toast;

public class GiantBombAppActivity extends ListActivity {
  private ListView mListView;

  private AchievementDatabase achievementDatabase;

  private AchievementUpdateService s;

  /** Called when the activity is first created. */
  @Override
  public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    mListView = getListView();
    List<Achievement> achievements = new ArrayList<Achievement>();
    achievementDatabase = new AchievementDatabase(this);
    achievementDatabase.open();
    //achievementDatabase.resetDatabase();
    achievements = achievementDatabase.getAllAchievements();

    MyAdapter adapter = new MyAdapter(this, achievements);
    setListAdapter(adapter);

    List<String> achievementNames = new ArrayList<String>();
    for(Achievement achievement: achievements) {
      achievementNames.add(achievement.getAchievementName());

      mListView.setOnItemClickListener(new OnItemClickListener() {
        public void onItemClick(AdapterView<?> parent, View view, int position, long id){
          //When clicked show a toast with the textview text
          Toast.makeText(getApplicationContext(), ((TextView) view).getText(), Toast.LENGTH_SHORT).show();
        }
      });

      doBindService();
    }
  }

  private ServiceConnection mConnection = new ServiceConnection() {

    public void onServiceConnected(ComponentName className, IBinder binder) {
      s = ((AchievementUpdateService.MyBinder) binder).getService();
      Toast.makeText(GiantBombAppActivity.this, "Connected", Toast.LENGTH_SHORT).show();
    }

    public void onServiceDisconnected(ComponentName className) {
      s = null;
    }
  };

  void doBindService() {
    bindService(new Intent(this, AchievementUpdateService.class), mConnection, Context.BIND_AUTO_CREATE);
  }

  /**
  * Adapter class to use for the list
  */
  private static class MyAdapter extends ArrayAdapter<Achievement> {

    /**
    * Constructor
    * 
    * @param context The context
    * @param contacts The list of contacts
    */
    public MyAdapter(final Context context, final List<Achievement> achievements) {
      super(context, 0, achievements);
    }

    @Override
    public View getView(final int position, final View convertView, final ViewGroup parent) {
      View view = convertView;
      if (view == null) {
        view = LayoutInflater.from(getContext()).inflate(R.layout.list_item, null);
      }

      final TextView achiev = (TextView)view.findViewById(R.id.achievement);
      if (getItem(position).getAchievmentRarity().compareTo("common") == 0) {
        achiev.setTextColor(Color.GREEN);
      }
      else if (getItem(position).getAchievmentRarity().compareTo("uncommon") == 0) {
        achiev.setTextColor(Color.BLUE);
      }
      else if (getItem(position).getAchievmentRarity().compareTo("rare") == 0) {
        achiev.setTextColor(Color.MAGENTA);
      }

      achiev.setText(getItem(position).getAchievementName());

      final TextView game = (TextView)view.findViewById(R.id.game);
      game.setText(getItem(position).getGameName());
        return view;
      }
    }
  }
}

Achievement update service:

package whiskeymedia.com;

import java.io.IOException;
import java.util.ArrayList;
import java.util.List;

import whiskeymedia.com.vo.Achievement;
import android.app.Service;
import android.content.Intent;
import android.os.Binder;
import android.os.IBinder;

public class AchievementUpdateService extends Service{

  private AchievementDatabase achievementDatabase;

  private final IBinder mBinder = new MyBinder();

  @Override
  public int onStartCommand(Intent intent, int flags, int startId) {
    HtmlParser htmlParser = new HtmlParser();
    try {
      List<Achievement> achievements= htmlParser.parseDocument();
      achievementDatabase.loadAchievements(achievements);
    } catch (IOException e) {
    // TODO Auto-generated catch block
    e.printStackTrace();
    }

    return Service.START_NOT_STICKY;
  }

  @Override
  public IBinder onBind(Intent arg0) {
    return mBinder;
  }

  public class MyBinder extends Binder {
    AchievementUpdateService getService() {
    return AchievementUpdateService.this;
    }
  }

}

Any idea what I am doing wrong?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T01:41:07+00:00Added an answer on June 4, 2026 at 1:41 am

    The crash is because the binder you’re getting back is an instance of BinderProxy, not your local binder class. This usually happens because your activity is attempting to bind to a service that is not in the same process. When binding across process boundaries, an instance of BinderProxy is used instead of the actual instance (since that’s in a different process).

    What does your AndroidManifest.xml look like?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have been trying to get it to work using this thread but can't
I have been trying to figure this out for a while now, but every
I have been trying to get a USB HID keyboard working on an Android
I have been trying to get my EditText box to word wrap, but can't
I have been trying to get this right but i dont know what i
I have been trying to get this program to work but so far having
I have been trying to get this one section of my UI to immediatly
I have been trying to get this to work correctly and I think I
I have been trying to get this jsfiddle to work. So far without luck.
I have been trying to days now to get this website completed ... however,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.