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 8293799
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T13:57:32+00:00 2026-06-08T13:57:32+00:00

This is the logcat. Would it be possible for someone to tell me why

  • 0

This is the logcat. Would it be possible for someone to tell me why this is happening:

07-29 18:20:44.109: D/AndroidRuntime(8836): Shutting down VM
07-29 18:20:44.109: W/dalvikvm(8836): threadid=1: thread exiting with uncaught exception (group=0x41443300)
07-29 18:20:44.109: E/AndroidRuntime(8836): FATAL EXCEPTION: main
07-29 18:20:44.109: E/AndroidRuntime(8836): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.liamwli.parent.trap/com.liamwli.parent.trap.ParentTrap}: java.lang.ClassCastException: com.liamwli.parent.trap.ParentTrap cannot be cast to android.app.Activity
07-29 18:20:44.109: E/AndroidRuntime(8836):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2096)
07-29 18:20:44.109: E/AndroidRuntime(8836):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2207)
07-29 18:20:44.109: E/AndroidRuntime(8836):     at android.app.ActivityThread.access$600(ActivityThread.java:139)
07-29 18:20:44.109: E/AndroidRuntime(8836):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1205)
07-29 18:20:44.109: E/AndroidRuntime(8836):     at android.os.Handler.dispatchMessage(Handler.java:99)
07-29 18:20:44.109: E/AndroidRuntime(8836):     at android.os.Looper.loop(Looper.java:137)
07-29 18:20:44.109: E/AndroidRuntime(8836):     at android.app.ActivityThread.main(ActivityThread.java:4896)
07-29 18:20:44.109: E/AndroidRuntime(8836):     at java.lang.reflect.Method.invokeNative(Native Method)
07-29 18:20:44.109: E/AndroidRuntime(8836):     at java.lang.reflect.Method.invoke(Method.java:511)
07-29 18:20:44.109: E/AndroidRuntime(8836):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:788)
07-29 18:20:44.109: E/AndroidRuntime(8836):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:555)
07-29 18:20:44.109: E/AndroidRuntime(8836):     at dalvik.system.NativeStart.main(Native Method)
07-29 18:20:44.109: E/AndroidRuntime(8836): Caused by: java.lang.ClassCastException: com.liamwli.parent.trap.ParentTrap cannot be cast to android.app.Activity
07-29 18:20:44.109: E/AndroidRuntime(8836):     at android.app.Instrumentation.newActivity(Instrumentation.java:1053)
07-29 18:20:44.109: E/AndroidRuntime(8836):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2087)
07-29 18:20:44.109: E/AndroidRuntime(8836):     ... 11 more

And the activity:

package com.liamwli.parent.trap;

import android.os.Bundle;
import android.app.Activity;
import android.app.admin.DeviceAdminReceiver;
import android.app.admin.DevicePolicyManager;
import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.Toast;
import android.support.v4.app.NavUtils;



class ParentTrap extends Activity {

    Button dae, dad, spass;
    EditText pass;
    ComponentName mDeviceAdminSample;
    static final int RESULT_ENABLE = 1;

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);

        dae = (Button) findViewById(R.id.benablea);
        dae.setOnClickListener(new View.OnClickListener() {

            @Override
            public void onClick(View arg0) {
                // TODO Auto-generated method stub

                mDeviceAdminSample = new ComponentName(ParentTrap.this,
                        Controller.class);

                Intent intent = new Intent(
                        DevicePolicyManager.ACTION_ADD_DEVICE_ADMIN);
                intent.putExtra(DevicePolicyManager.EXTRA_DEVICE_ADMIN,
                        mDeviceAdminSample);
                intent.putExtra(DevicePolicyManager.EXTRA_ADD_EXPLANATION,
                        "Title");
                startActivityForResult(intent, RESULT_ENABLE);

            }
        });
        dad = (Button) findViewById(R.id.button1);
        dad.setOnClickListener(new View.OnClickListener() {

            @Override
            public void onClick(View arg0) {
                // TODO Auto-generated method stub

            }
        });
        spass = (Button) findViewById(R.id.button2);
        spass.setOnClickListener(new View.OnClickListener() {

            @Override
            public void onClick(View arg0) {
                // TODO Auto-generated method stub

            }
        });

        pass = (EditText) findViewById(R.id.editText1);

        dad.setEnabled(false);
    }

    public class Controller extends DeviceAdminReceiver {

        void showToast(Context context, String msg) {
            String status = "Status";
            Toast.makeText(context, status, Toast.LENGTH_SHORT).show();
        }

        @Override
        public void onEnabled(Context context, Intent intent) {
            showToast(context, "Enabled");
        }

        @Override
        public CharSequence onDisableRequested(Context context, Intent intent) {
            return "Disable Requested";
        }

        @Override
        public void onDisabled(Context context, Intent intent) {
            showToast(context, "Disabled");
        }

        @Override
        public void onPasswordChanged(Context context, Intent intent) {
            showToast(context, "Device PIN Changed");
        }

    }

}

class evilliam {

}
// @Override
// public boolean onCreateOptionsMenu(Menu menu) {
// getMenuInflater().inflate(R.menu.main, menu);
// return true;
// }

Thank you for any help – I have been trying to follow the dev docs :/

NEW LOGCAT:

07-29 18:43:25.404: D/dalvikvm(13404): newInstance failed: Lcom/liamwli/parent/trap/ParentTrap; not accessible to Landroid/app/Instrumentation;
07-29 18:43:25.404: D/AndroidRuntime(13404): Shutting down VM
07-29 18:43:25.404: W/dalvikvm(13404): threadid=1: thread exiting with uncaught exception (group=0x41443300)
07-29 18:43:25.419: E/AndroidRuntime(13404): FATAL EXCEPTION: main
07-29 18:43:25.419: E/AndroidRuntime(13404): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.liamwli.parent.trap/com.liamwli.parent.trap.ParentTrap}: java.lang.IllegalAccessException: access to class not allowed
07-29 18:43:25.419: E/AndroidRuntime(13404):    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2096)
07-29 18:43:25.419: E/AndroidRuntime(13404):    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2207)
07-29 18:43:25.419: E/AndroidRuntime(13404):    at android.app.ActivityThread.access$600(ActivityThread.java:139)
07-29 18:43:25.419: E/AndroidRuntime(13404):    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1205)
07-29 18:43:25.419: E/AndroidRuntime(13404):    at android.os.Handler.dispatchMessage(Handler.java:99)
07-29 18:43:25.419: E/AndroidRuntime(13404):    at android.os.Looper.loop(Looper.java:137)
07-29 18:43:25.419: E/AndroidRuntime(13404):    at android.app.ActivityThread.main(ActivityThread.java:4896)
07-29 18:43:25.419: E/AndroidRuntime(13404):    at java.lang.reflect.Method.invokeNative(Native Method)
07-29 18:43:25.419: E/AndroidRuntime(13404):    at java.lang.reflect.Method.invoke(Method.java:511)
07-29 18:43:25.419: E/AndroidRuntime(13404):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:788)
07-29 18:43:25.419: E/AndroidRuntime(13404):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:555)
07-29 18:43:25.419: E/AndroidRuntime(13404):    at dalvik.system.NativeStart.main(Native Method)
07-29 18:43:25.419: E/AndroidRuntime(13404): Caused by: java.lang.IllegalAccessException: access to class not allowed
07-29 18:43:25.419: E/AndroidRuntime(13404):    at java.lang.Class.newInstanceImpl(Native Method)
07-29 18:43:25.419: E/AndroidRuntime(13404):    at java.lang.Class.newInstance(Class.java:1319)
07-29 18:43:25.419: E/AndroidRuntime(13404):    at android.app.Instrumentation.newActivity(Instrumentation.java:1053)
07-29 18:43:25.419: E/AndroidRuntime(13404):    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2087)
07-29 18:43:25.419: E/AndroidRuntime(13404):    ... 11 more
07-29 18:43:27.214: I/Process(13404): Sending signal. PID: 13404 SIG: 9
  • 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-08T13:57:33+00:00Added an answer on June 8, 2026 at 1:57 pm

    It looks like your app is assuming that ParentTrap is an Activity (which it is not, Controller is the Activity), you can:

    1. Remove public from ParentTrap’s declaration:

      class ParentTrap extends DeviceAdminReceiver {
      

      and make Controller the public class (i.e. the main class):

      public class Controller extends Activity {
      
    2. Nest the ParentTrap class inside Controller:

      public class Controller extends Activity {
          public class ParentTrap extends DeviceAdminReceiver {...}
      
          ...
      }
      
    3. Put ParentTrap in it’s own file (ParentTrap.java)

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

Sidebar

Related Questions

I am getting this LogCat: 06-22 15:30:53.731: E/AndroidRuntime(2389): java.lang.NumberFormatException: Invalid float: null 06-22 15:30:53.731:
This is the error occurs in logcat,can anyone tell what's the meaning? private int
i got this error in the logcat 06-21 11:58:27.275: E/AndroidRuntime(404): java.lang.RuntimeException: Unable to start
I get this error message in LogCat: 06-25 15:17:34.495: E/AndroidRuntime(5891): java.lang.RuntimeException: Unable to start
Why does this c++ (NDK) thread brings the whole program down ? { sleep(2);
I am getting this exception in the LogCat: Unable to start service Intent {
this is my first question in here, and I would like to ask if
I am getting the IllegalAccessError while running Android instrumentation tests. This is Logcat output:
So my latest app runs into this problem where it complains in the logcat
I have seen someone complain about that Logcat only output the last line. I

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.