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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T00:45:10+00:00 2026-05-27T00:45:10+00:00

I spent a very long time trying to locate the error but I can’t

  • 0

I spent a very long time trying to locate the error but I can’t seem to find an answer that works online. The situation is that LogCat produces this error every time I click on an option in the list: android.content.ActivityNotFoundException: Unable to find explicit activity class.

Manifest file:

<?xml version="1.0" encoding="utf-8"?>
<manifest package="com.capture.ProcessCapture"
    android:versionCode="1"
    android:versionName="1.0" xmlns:android="http://schemas.android.com/apk/res/android">

    <uses-sdk android:minSdkVersion="7" /><uses-permission android:name="android.permission.GET_TASKS"/>
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />

    <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"/>
    <uses-permission android:name="android.permission.WAKE_LOCK"/>
<application android:icon="@drawable/ic_launcher" android:label="@string/app_name">
        <activity android:label="@string/app_name" android:name=".ProcessCaptureActivity">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        <activity android:name=".FileData" android:label="@string/app_name">
        </activity>
        <service android:name=".BackgroundCapture" android:enabled="true" android:process=":Background" android:permission="android.permission.WAKE_LOCK" android:label="@string/app_name"></service>
        <receiver android:name=".BootReceiver" android:label="@string/app_name" android:enabled="true">
            <intent-filter>
                <action android:name="android.intent.action.BOOT_COMPLETED" />
            </intent-filter>
        </receiver>
    </application>
</manifest>

ProcessCaptureActivity.java (Main class):

package com.capture.ProcessCapture;
... (all the imports)

public class ProcessCaptureActivity extends ListActivity {
    private File dir = new File(Environment.getExternalStorageDirectory().getAbsolutePath() + "/ProcessCapture/data");
    private String accessedFile;

    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        onResume();
        setListAdapter(new ArrayAdapter<String>(this, R.layout.list_item, capturedFiles()));
        ListView lv = getListView();
        lv.setTextFilterEnabled(true);

        lv.setOnItemClickListener(new OnItemClickListener() {
            public void onItemClick(AdapterView<?> parent, View view,
                int position, long id) {
              // Get file name:
                accessedFile = ((TextView) view).getText().toString();
                Intent newIntent = new Intent(view.getContext(), FileData.class);
                newIntent.putExtra("filename", accessedFile);
                startActivity(newIntent);
            }
          });
    }

    public void onResume() {
        super.onResume();
        //Timeout for 30min (Using AlarmManager)
        Intent myIntent = new Intent(this, BackgroundCapture.class);
        PendingIntent pendingIntent = PendingIntent.getService(this, 0, myIntent, 0);
        AlarmManager alarmManager = (AlarmManager) getSystemService(ALARM_SERVICE);
        alarmManager.cancel(pendingIntent);
        alarmManager.setInexactRepeating(AlarmManager.ELAPSED_REALTIME_WAKEUP, 0, AlarmManager.INTERVAL_HALF_HOUR, pendingIntent);
    }

    private String[] capturedFiles() {
        return dir.list();
    }

}

FileData.java

package com.capture.ProcessCapture;

... (all the imports)

public class FileData extends Activity {

    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        File sdcard = Environment.getExternalStorageDirectory();

        Bundle bundle = this.getIntent().getExtras();
        String filename = bundle.getString("filename");
        File file = new File(sdcard+"/ProcessCapture/data", filename);

        StringBuilder text = new StringBuilder();

        try {
            BufferedReader br = new BufferedReader(new FileReader(file));
            String line;

            while((line = br.readLine()) != null) {
                text.append(line);
                text.append('\n');
            }
        } catch (IOException ioe) {
            ioe.printStackTrace();
        }

        TextView tv = (TextView) findViewById(R.id.file_data);
        tv.setText(text);

        setContentView(R.layout.file_data);
    }

}

Full LogCat: (Which only shows error when a list item is clicked)

11-05 10:45:28.743: E/AndroidRuntime(907): FATAL EXCEPTION: main
11-05 10:45:28.743: E/AndroidRuntime(907): android.content.ActivityNotFoundException: Unable to find explicit activity class {com.capture.ProcessCapture/com.capture.ProcessCapture.FileData}; have you declared this activity in your AndroidManifest.xml?
11-05 10:45:28.743: E/AndroidRuntime(907):  at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:1405)
11-05 10:45:28.743: E/AndroidRuntime(907):  at android.app.Instrumentation.execStartActivity(Instrumentation.java:1379)
11-05 10:45:28.743: E/AndroidRuntime(907):  at android.app.Activity.startActivityForResult(Activity.java:2827)
11-05 10:45:28.743: E/AndroidRuntime(907):  at android.app.Activity.startActivity(Activity.java:2933)
11-05 10:45:28.743: E/AndroidRuntime(907):  at com.capture.ProcessCapture.ProcessCaptureActivity$1.onItemClick(ProcessCaptureActivity.java:37)
11-05 10:45:28.743: E/AndroidRuntime(907):  at android.widget.AdapterView.performItemClick(AdapterView.java:284)
11-05 10:45:28.743: E/AndroidRuntime(907):  at android.widget.ListView.performItemClick(ListView.java:3513)
11-05 10:45:28.743: E/AndroidRuntime(907):  at android.widget.AbsListView$PerformClick.run(AbsListView.java:1812)
11-05 10:45:28.743: E/AndroidRuntime(907):  at android.os.Handler.handleCallback(Handler.java:587)
11-05 10:45:28.743: E/AndroidRuntime(907):  at android.os.Handler.dispatchMessage(Handler.java:92)
11-05 10:45:28.743: E/AndroidRuntime(907):  at android.os.Looper.loop(Looper.java:123)
11-05 10:45:28.743: E/AndroidRuntime(907):  at android.app.ActivityThread.main(ActivityThread.java:3683)
11-05 10:45:28.743: E/AndroidRuntime(907):  at java.lang.reflect.Method.invokeNative(Native Method)
11-05 10:45:28.743: E/AndroidRuntime(907):  at java.lang.reflect.Method.invoke(Method.java:507)
11-05 10:45:28.743: E/AndroidRuntime(907):  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
11-05 10:45:28.743: E/AndroidRuntime(907):  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
11-05 10:45:28.743: E/AndroidRuntime(907):  at dalvik.system.NativeStart.main(Native Method)

Thanks in advance! Sorry for the long question =)

  • 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-05-27T00:45:11+00:00Added an answer on May 27, 2026 at 12:45 am

    (Copy from my comment above) The problem was ‘solved’ when I used ubuntu instead of windows =/ The root problem was in FileData.java, where the setContentView(R.layout.file_data) had to be called before setting text to it’s TextView (tv).

    The new code for FileData.java is:

    package com.capture.ProcessCapture;
    
    ... (all the imports)
    
    public class FileData extends Activity {
    
        public void onCreate(Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);
            File sdcard = Environment.getExternalStorageDirectory();
    
            Bundle bundle = this.getIntent().getExtras();
            String filename = bundle.getString("filename");
            File file = new File(sdcard+"/ProcessCapture/data", filename);
    
            StringBuilder text = new StringBuilder();
    
            try {
                BufferedReader br = new BufferedReader(new FileReader(file));
                String line;
    
                while((line = br.readLine()) != null) {
                    text.append(line);
                    text.append('\n');
                }
            } catch (IOException ioe) {
                ioe.printStackTrace();
            }
    
            setContentView(R.layout.file_data);
    
            TextView tv = (TextView) findViewById(R.id.file_data);
            tv.setText(text);
        }
    
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am very confused and have spent a long time trying to debug this
I have some php code, that execute for a very long time. I need
I'm trying to investigate a very long start up time for my app and
I have spent hours trying to work this out, and spent a long time
I just spent a very long time debugging an issue in python, using the
It's been a very long time since I coded in C, and I've spent
Spent many hours and still can't figure that out. sampleData.json file contains the following
Have spent an hour trying to solve this - but to no avail. I'm
I spent a long time learning how to customise WCF from the point of
I have a very strange error happening in an App that has been working

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.