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

The Archive Base Latest Questions

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

i have prepared paint application,my application contains one custom view for paint.when we draw

  • 0

i have prepared paint application,my application contains one custom view for paint.when we draw any thing in custom view just collect the drawn pixels and store in array list,first it’s working fine(but it’s taking lot of time) and second time ”
Activity MyAlphabets(in application MyAlphabets)is not responding(force close and wait)”.

My code is,

public void onDraw(Canvas canvas) {

        if (myDrawBitmap == null) {
            myDrawBitmap = Bitmap.createBitmap(canvas.getWidth(),
                    canvas.getHeight(), Bitmap.Config.ARGB_8888);
            bmpDrawCanvas = new Canvas(myDrawBitmap);
            intDrawArray = new int[myDrawBitmap.getWidth()
                    * myDrawBitmap.getHeight()];
        }
        if (bmpDrawCanvas != null) {
            for (Path path : MyActivity.mArryLstPath) {
                bmpDrawCanvas.drawPath(MyActivity.mPath,
                        mPaintAlphabet);
            }
myDrawBitmap.getPixels(intDrawArray, 0, 220, 0, 0, 220, 305);
                   for (int i = 0; i < intDrawArray.length; i ++) {

                if (intDrawArray[i] == 0xFFFFFFFF) {

                    if (MyActivity.mArryLstDrawnPixels.contains(i)) {

                    } else {
                        MyActivity.mArryLstDrawnPixels.add(i);
                    }
                }
}

when we click on “force close” Logcat is,

INFO/ActivityManager(52): Killing process com.qteq.myapplication (pid=225) at user's request

 INFO/Process(52): Sending signal. PID: 225 SIG: 9

 INFO/ActivityManager(52): Process com.qteq.myapplication (pid 225) has died.

 INFO/WindowManager(52): WIN DEATH: Window{608fbd10 com.qtq.myapplication/com.qtq.myapplication.MyApplicationActivity paused=false}

 INFO/UsageStats(52): Unexpected resume of com.android.launcher while already resumed in com.qtq.myapplication
 ERROR/gralloc(52): [unregister] handle 0x4a2740 still locked (state=40000001)

 WARN/InputManagerService(52): Got RemoteException sending setActive(false) notification to pid 225 uid 10025

This is correct way to collect color pixels at the time of draw.Please help me..

how to solve this problem. please help me..

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

    Your application is bound to get “Application not responding” errors since you’re doing all your computation, including allocation in the UI thread (onDraw).

    Firstly, you should try moving the computations into a non-ui thread (see AsyncTask). Any operation that is taking more than 20ms is bound to invoke the “Application Not responding” message.

    Secondly, you should try and refactor your code such that you do not have to perform the computation every time you have to draw. Basically render your image is an off screen bitmap, cache it and render it from the cached copy in onDraw. The scope of “how to”, I’m afraid, is beyond the scope of this discussion.

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

Sidebar

Related Questions

i have prepared one custom view using onDraw method, my view class is, public
I have my application designed with Repository pattern implemented and my code prepared for
Problem is like this: I have two winapi application's. There is only one way
We have a Prepared Statement in Java and we hear that it is different
I Have a prepared statement INSERT INTO mst(time) VALUES (?); where time is of
I have heard that prepared statements with SQLite should improve performance. I wrote some
Is it possible to have a MySQLi prepared statement within the fetch() call of
I have a function that I use called sqlf(), it emulates prepared statements. For
The JDBC 3.0 spec talks about Connection (and Prepared Statement) pooling. We have several
I have the pretty print module, which I prepared because I was not happy

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.