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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T19:13:56+00:00 2026-05-27T19:13:56+00:00

I am working on a contact list project in android and i want to

  • 0

I am working on a contact list project in android and i want to make a browse button to browse an image and save it in my database for every contact.And then i want to display the image on the screen.
could you give me please a good example or tutorial of how to browse images and save it/retrieve from database?

For begin i tried just to make program to browse the image but i get an error.

here is my .java:

  package ianco.test.andrei;
  import android.app.Activity;
  import android.content.Intent;
  import android.database.Cursor;
  import android.net.Uri;
  import android.os.Bundle;
  import android.provider.MediaStore;
  import android.view.View;
  import android.view.View.OnClickListener;
  import android.widget.Button;

  public class BrowsePicture extends Activity {

//YOU CAN EDIT THIS TO WHATEVER YOU WANT
private static final int SELECT_PICTURE = 1;

private String selectedImagePath;
//ADDED
private String filemanagerstring;

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



   Button sButton = (Button) findViewById(R.id.button1);
   sButton.setOnClickListener(new OnClickListener() {

        public void onClick(View arg0) {

            // in onCreate or any event where your want the user to
            // select a file
            Intent intent = new Intent();
            intent.setType("image/*");
            intent.setAction(Intent.ACTION_GET_CONTENT);
            startActivityForResult(Intent.createChooser(intent,
                    "Select Picture"), SELECT_PICTURE);
        }
    });
}

//UPDATED
public void onActivityResult(int requestCode, int resultCode, Intent data) {
    if (resultCode == RESULT_OK) {
        if (requestCode == SELECT_PICTURE) {
            Uri selectedImageUri = data.getData();

            //OI FILE Manager
            filemanagerstring = selectedImageUri.getPath();

            //MEDIA GALLERY
            selectedImagePath = getPath(selectedImageUri);

            //DEBUG PURPOSE - you can delete this if you want
            if(selectedImagePath!=null)
                System.out.println(selectedImagePath);
            else System.out.println("selectedImagePath is null");
            if(filemanagerstring!=null)
                System.out.println(filemanagerstring);
            else System.out.println("filemanagerstring is null");

            //NOW WE HAVE OUR WANTED STRING
            if(selectedImagePath!=null)
                System.out.println("selectedImagePath is the right one for you!");
            else
                System.out.println("filemanagerstring is the right one for you!");
        }
    }
}

//UPDATED!
public String getPath(Uri uri) {
    String[] projection = { MediaStore.Images.Media.DATA };
    Cursor cursor = managedQuery(uri, projection, null, null, null);
    if(cursor!=null)
    {
        //HERE YOU WILL GET A NULLPOINTER IF CURSOR IS NULL
        //THIS CAN BE, IF YOU USED OI FILE MANAGER FOR PICKING THE MEDIA
        int column_index = cursor
        .getColumnIndexOrThrow(MediaStore.Images.Media.DATA);
        cursor.moveToFirst();
        return cursor.getString(column_index);
    }
    else return null;
}

}

Error is:12-24 00:14:07.742: E/AndroidRuntime(365): FATAL EXCEPTION: main
12-24 00:14:07.742: E/AndroidRuntime(365): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{ianco.test.andrei/ianco.test.andrei.TestareActivity}: java.lang.ClassNotFoundException: ianco.test.andrei.TestareActivity in loader dalvik.system.PathClassLoader[/data/app/ianco.test.andrei-1.apk]
12-24 00:14:07.742: E/AndroidRuntime(365): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2585)
12-24 00:14:07.742: E/AndroidRuntime(365): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)
12-24 00:14:07.742: E/AndroidRuntime(365): at android.app.ActivityThread.access$2300(ActivityThread.java:125)
12-24 00:14:07.742: E/AndroidRuntime(365): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)
12-24 00:14:07.742: E/AndroidRuntime(365): at android.os.Handler.dispatchMessage(Handler.java:99)
12-24 00:14:07.742: E/AndroidRuntime(365): at android.os.Looper.loop(Looper.java:123)
12-24 00:14:07.742: E/AndroidRuntime(365): at android.app.ActivityThread.main(ActivityThread.java:4627)
12-24 00:14:07.742: E/AndroidRuntime(365): at java.lang.reflect.Method.invokeNative(Native Method)
12-24 00:14:07.742: E/AndroidRuntime(365): at java.lang.reflect.Method.invoke(Method.java:521)
12-24 00:14:07.742: E/AndroidRuntime(365): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
12-24 00:14:07.742: E/AndroidRuntime(365): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
12-24 00:14:07.742: E/AndroidRuntime(365): at dalvik.system.NativeStart.main(Native Method)
12-24 00:14:07.742: E/AndroidRuntime(365): Caused by: java.lang.ClassNotFoundException: ianco.test.andrei.TestareActivity in loader dalvik.system.PathClassLoader[/data/app/ianco.test.andrei-1.apk]
12-24 00:14:07.742: E/AndroidRuntime(365): at dalvik.system.PathClassLoader.findClass(PathClassLoader.java:243)
12-24 00:14:07.742: E/AndroidRuntime(365): at java.lang.ClassLoader.loadClass(ClassLoader.java:573)
12-24 00:14:07.742: E/AndroidRuntime(365): at java.lang.ClassLoader.loadClass(ClassLoader.java:532)
12-24 00:14:07.742: E/AndroidRuntime(365): at android.app.Instrumentation.newActivity(Instrumentation.java:1021)
12-24 00:14:07.742: E/AndroidRuntime(365): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2577)

  • 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-27T19:13:56+00:00Added an answer on May 27, 2026 at 7:13 pm

    Your manifest has a reference to a TestareActivity that does not exist:

    00:14:07.742: E/AndroidRuntime(365): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{ianco.test.andrei/ianco.test.andrei.TestareActivity}: java.lang.ClassNotFoundException: ianco.test.andrei.TestareActivity in loader dalvik.system.PathClassLoader[/data/app/ianco.test.andrei-1.apk]
    

    Either fix the manifest or add the missing activity.

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

Sidebar

Related Questions

I am working on android apps. I want to add a contact in android
I am working on a contact list project and the last thing i need
I want to make button unclickable using setClicable() but it's not working. I am
Working on a project, one of the webpages will display a list of people
I have referred this code to display contact list. and it is working fine
I am working on a contact list project and so far i can add,modify
I am using Simple Listview to display Email addresses from Contact List. Its working
I am working on a contact list application I need to create 2 tables
I'm currently working in an app that shows a contact list to the user.
I'm working on a small project that involves grabbing a list of contacts which

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.