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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T14:51:46+00:00 2026-05-26T14:51:46+00:00

I have button of pick image from android gallery in one activity name DrawingActivity.

  • 0

I have button of pick image from android gallery in one activity name DrawingActivity. and there is another activity name as DrawingSurface. In DrawingSurface activity i am using thread to draw the canvas and handle it.

Now while i am going to pickup the Image from gallery i got error like this:

11-04 12:12:50.226: ERROR/AndroidRuntime(518): FATAL EXCEPTION: main
11-04 12:12:50.226: ERROR/AndroidRuntime(518): java.lang.IllegalThreadStateException: Thread already started.
11-04 12:12:50.226: ERROR/AndroidRuntime(518):     at java.lang.Thread.start(Thread.java:1322)
11-04 12:12:50.226: ERROR/AndroidRuntime(518):     at com.example.drawing.DrawingSurface.surfaceCreated(DrawingSurface.java:106)
11-04 12:12:50.226: ERROR/AndroidRuntime(518):     at android.view.SurfaceView.updateWindow(SurfaceView.java:532)
11-04 12:12:50.226: ERROR/AndroidRuntime(518):     at android.view.SurfaceView.onWindowVisibilityChanged(SurfaceView.java:206)
11-04 12:12:50.226: ERROR/AndroidRuntime(518):     at android.view.View.dispatchWindowVisibilityChanged(View.java:3891)
11-04 12:12:50.226: ERROR/AndroidRuntime(518):     at android.view.ViewGroup.dispatchWindowVisibilityChanged(ViewGroup.java:719)
11-04 12:12:50.226: ERROR/AndroidRuntime(518):     at android.view.ViewGroup.dispatchWindowVisibilityChanged(ViewGroup.java:719)
11-04 12:12:50.226: ERROR/AndroidRuntime(518):     at android.view.ViewGroup.dispatchWindowVisibilityChanged(ViewGroup.java:719)
11-04 12:12:50.226: ERROR/AndroidRuntime(518):     at android.view.ViewGroup.dispatchWindowVisibilityChanged(ViewGroup.java:719)
11-04 12:12:50.226: ERROR/AndroidRuntime(518):     at android.view.ViewRoot.performTraversals(ViewRoot.java:744)
11-04 12:12:50.226: ERROR/AndroidRuntime(518):     at android.view.ViewRoot.handleMessage(ViewRoot.java:1727)
11-04 12:12:50.226: ERROR/AndroidRuntime(518):     at android.os.Handler.dispatchMessage(Handler.java:99)
11-04 12:12:50.226: ERROR/AndroidRuntime(518):     at android.os.Looper.loop(Looper.java:123)
11-04 12:12:50.226: ERROR/AndroidRuntime(518):     at android.app.ActivityThread.main(ActivityThread.java:4627)
11-04 12:12:50.226: ERROR/AndroidRuntime(518):     at java.lang.reflect.Method.invokeNative(Native Method)
11-04 12:12:50.226: ERROR/AndroidRuntime(518):     at java.lang.reflect.Method.invoke(Method.java:521)
11-04 12:12:50.226: ERROR/AndroidRuntime(518):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
11-04 12:12:50.226: ERROR/AndroidRuntime(518):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
11-04 12:12:50.226: ERROR/AndroidRuntime(518):     at dalvik.system.NativeStart.main(Native Method)

==========================

The Line where i got this error on DrawingSurface activity is as below:

 public void surfaceCreated(SurfaceHolder holder) {
    // TODO Auto-generated method stub
        thread.setRunning(true);
        thread.start(); // error at this line
}

I am using this code to pick image on button pressed:

Intent intent = new Intent(); 
            intent.setType("image/*"); 
            intent.setAction(Intent.ACTION_GET_CONTENT);// 
            //startActivity(intent);
            startActivityForResult(Intent.createChooser(intent, "Select Picture"),10);
            //finish();

So Now can anybudy tell me how i can handle this error ?

Thanks.

  • 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-26T14:51:46+00:00Added an answer on May 26, 2026 at 2:51 pm

    You should use thread.isAlive() before starting the Thread .

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

Sidebar

Related Questions

I have button, which fires an event, that deletes a record from the database.
I have one issue with Datetime Picker In my firstview i have button.If i
I have one issue with UInavigationcontroller In my firstview i have button.If i click
We have a button that saves asynchronously using AjaxToolKit/C#/.NET. I'm getting this in my
I have a radio button set called pick_up_point. There are 3 options and clicking
I've made a app with two buttons one to select an image from the
When using the following code to select a picture from my gallery, I also
I have made the same image button in 36x36,48x48,72x72 and 96x96 and put them
Possible Duplicate: How to get a list of installed android applications and pick one
I have form 1 and form 2. From form 1 I have a button

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.