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

  • Home
  • SEARCH
  • 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 6385329
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T02:53:08+00:00 2026-05-25T02:53:08+00:00

E/AndroidRuntime( 5751): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.Android/com.example.Android.OpenByApiActivity}: android.content.res.Resources$NotFoundException: Resource ID #0x7f030001 E/AndroidRuntime( 5751):

  • 0

E/AndroidRuntime( 5751): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.Android/com.example.Android.OpenByApiActivity}: android.content.res.Resources$NotFoundException: Resource ID #0x7f030001

E/AndroidRuntime( 5751): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1647)

E/AndroidRuntime( 5751): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1663)

E/AndroidRuntime( 5751): at android.app.ActivityThread.access$1500(ActivityThread.java:117)

E/AndroidRuntime( 5751): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:931)

E/AndroidRuntime( 5751): Caused by: android.content.res.Resources$NotFoundException: Resource ID #0x7f030001

Does anybody know why this is being thrown? This is my code for the video and xml

public class OpenByApiActivity extends Activity implements Callback {


MediaPlayer mp = new MediaPlayer();
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
requestWindowFeature(Window.FEATURE_NO_TITLE);
setContentView(R.layout.video);
StringBuilder log = new StringBuilder();
    String[] clearLogcat = new String[] { "logcat", "-c",};
    try {
        Runtime.getRuntime().exec(clearLogcat);
    } 
    catch (IOException e) { 
        e.printStackTrace();
    }
              File location = new File("/sdcard/MediaTestFiles/sample.mp4");
    Uri path = Uri.fromFile(location);      
    SurfaceView surfaceView;
    SurfaceHolder surfaceHolder;
    getWindow().setFormat(PixelFormat.UNKNOWN);
    surfaceView = (SurfaceView)findViewById(R.id.surfaceview);
    surfaceHolder = surfaceView.getHolder();
    surfaceHolder.addCallback(this);
    surfaceHolder.setFixedSize(176, 144);
    surfaceHolder.setType(SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS);
    mp.setAudioStreamType(AudioManager.STREAM_MUSIC);
    mp.setDisplay(surfaceHolder);
    mp= MediaPlayer.create(this, path);         
    if(mp!=null){
    mp.start();
                   }}}
                @Override
public void surfaceChanged(SurfaceHolder arg0, int arg1, int arg2, int arg3) {
    // TODO Auto-generated method stub

}

@Override
public void surfaceCreated(SurfaceHolder arg0) {
    // TODO Auto-generated method stub

}

@Override
public void surfaceDestroyed(SurfaceHolder arg0) {
    // TODO Auto-generated method stub

}}
         <?xml version="1.0" encoding="utf-8"?>
     <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
    <TextView  
android:layout_width="fill_parent" 
android:layout_height="wrap_content" 
android:text="@string/hello"
/>

   <SurfaceView
  android:id="@+id/surfaceview"
  android:layout_width="fill_parent"
  android:layout_height="wrap_content"
    />  
    </LinearLayout>
  • 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-25T02:53:09+00:00Added an answer on May 25, 2026 at 2:53 am

    can you try this and tell me if you still have the same problem

    final File location = new File(Environment.getExternalStorageDirectory(), "/MediaTestFiles/sample.mp4");
    

    i guess the problem may be with your path.

    UPDATE

    can you move this line

    @Override
    public void surfaceCreated(SurfaceHolder arg0) {
        //mp.setDisplay(surfaceHolder);
        mp.setDisplay(arg0);
    }
    

    inside the onSurfaceCreated.

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

Sidebar

Related Questions

What causing this Android RuntimeException? 02-01 15:13:41.316: ERROR/AndroidRuntime(3989): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.cccc.xxxx/com.cccc.xxxx.ActivityMyScreen}:
Logcat 08-17 06:37:22.264: ERROR/AndroidRuntime(1090): java.lang.RuntimeException: Unable to start activity ComponentInfo{one.two/one.two.Booking}: java.lang.NullPointerException 08-17 06:37:22.264: ERROR/AndroidRuntime(1090):
I get the following error: ERROR/AndroidRuntime(294): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.e/views.L}: java.lang.InstantiationException: com.e.views.L
12-19 18:29:33.203: ERROR/AndroidRuntime(402): FATAL EXCEPTION: main 12-19 18:29:33.203: ERROR/AndroidRuntime(402): java.lang.RuntimeException: Unable to start activity
I got this exception 01-03 00:28:43.465 E/AndroidRuntime(13556): java.lang.NoSuchMethodError: android.content.pm.PackageManager.currentToCanonicalPackageNames 01-03 00:28:43.465 E/AndroidRuntime(13556): at com.android.DL_launcher.LauncherProvider$DatabaseHelper.addAppShortcut(LauncherProvider.java:632)
In Android Emulator i am getting below Logcat Error: 03-11 04:44:56.663: ERROR/AndroidRuntime(403): java.lang.RuntimeException: Unable
the error in my logcat is such Logcat 08-29 08:20:57.961: ERROR/AndroidRuntime(1766): java.lang.RuntimeException: Unable to
I am getting below error. java.lang.NullPointerException 11-14 16:46:59.093: E/AndroidRuntime(4064): at android.content.ContextWrapper.getContentResolver(ContextWrapper.java:90) Using below code.
I get the ERROR/AndroidRuntime(609): android.content.ActivityNotFoundException: Unable to find explicit activity class {mark.the.map/mark.the.map.ShowTheMap}; have you
07-30 21:02:39.260: ERROR/AndroidRuntime(7961): java.lang.NullPointerException 07-30 21:02:39.260: ERROR/AndroidRuntime(7961): at com.fttech.gameIT.shoppingClass$1.onClick(shoppingClass.java:45) 07-30 21:02:39.260: ERROR/AndroidRuntime(7961): at android.view.View.performClick(View.java:3110)

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.