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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T10:19:38+00:00 2026-06-17T10:19:38+00:00

I have a program that logs USB data to a file that I create

  • 0

I have a program that logs USB data to a file that I create and it works fine.
I am trying to display some of this data using setText but the setText executes once correctly and then the next time it is called I get a Source not found crash.

I am saving the USB data to my file in this Run:

    @Override
public void run() {
    ByteBuffer buffer = ByteBuffer.allocate(64);
    UsbRequest request = new UsbRequest();
    request.initialize(mConnection, mEndpointIntr);
    while (true) {
        request.queue(buffer, 64);
        if (mConnection.requestWait() == request) {
            znum.setText("help"); 
            savetofile("GOT data " + System.currentTimeMillis());
            try {
                Thread.sleep(100);
            } catch (InterruptedException e) {
            }
        } else {
            Log.e(TAG, "requestWait failed, exiting");
            savetofile("10 requestWait failed, exiting");
            break;
        }
    }
}

If I rem out the setText line in the above, the program runs happily, saving my data to a file.
When I run the code as above, the program crashes and I get a Source not found indication.

If I start the program with a break on the savetofile line, the layout gets updated with tvZnum set to help just fine.

Then I step thru the code and get back to the setText line.

All is fine until I execute setText the second time, then it crashes.

It seems to be at android.view.ViewRootImpl.checkThread() line 4077 when it crashes. I tried to add a screen capture image to my post here but I don’t have enough reputation points yet.

I declare:

    TextView znum;

And have this in OnCreate:

    znum = (TextView) findViewById(R.id.tvZnum);

And tvZnum shows up fine in the launcher and R.

I know the answer must be simple but simple me can’t figure it out.

Any ideas out there?

Thanks,
Dale

Edit: Here is logCat (Greek to me and I couldn’t figure out how to format it here):

I/dalvikvm( 1529): threadid=3: reacting to signal 3

I/dalvikvm( 1529): Wrote stack traces to ‘/data/anr/traces.txt’

I/System.out( 1529): waiting for debugger to settle…

I/System.out( 1529): waiting for debugger to settle…

I/Process ( 167): Sending signal. PID: 1529 SIG: 3

I/dalvikvm( 1529): threadid=3: reacting to signal 3

I/System.out( 1529): waiting for debugger to settle…

I/dalvikvm( 1529): Wrote stack traces to ‘/data/anr/traces.txt’

I/System.out( 1529): waiting for debugger to settle…

I/System.out( 1529): waiting for debugger to settle…

I/Process ( 167): Sending signal. PID: 1529 SIG: 3

I/dalvikvm( 1529): threadid=3: reacting to signal 3

I/dalvikvm( 1529): Wrote stack traces to ‘/data/anr/traces.txt’

I/System.out( 1529): waiting for debugger to settle…

I/System.out( 1529): waiting for debugger to settle…

I/Process ( 167): Sending signal. PID: 1529 SIG: 3

I/dalvikvm( 1529): threadid=3: reacting to signal 3

I/dalvikvm( 1529): Wrote stack traces to ‘/data/anr/traces.txt’

I/System.out( 1529): waiting for debugger to settle…

I/System.out( 1529): waiting for debugger to settle…

I/System.out( 1529): debugger has settled (1359)

I/Process ( 167): Sending signal. PID: 1529 SIG: 3

I/dalvikvm( 1529): threadid=3: reacting to signal 3

I/dalvikvm( 1529): Wrote stack traces to ‘/data/anr/traces.txt’

D/dalvikvm( 1529): threadid=1: still suspended after undo (sc=1 dc=1)

D/ProMeasure2DActivity( 1529): intent: Intent {
act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER]
flg=0x10000000
cmp=com.android.missilelauncher/.MissileLauncherActivity }

D/ProMeasure2DActivity( 1529): setDevice
UsbDevice[mName=/dev/bus/usb/001/002,mVendorId=1240,mProductId=63,mClass=0,mSubclass=0,mProtocol=0,mInterfaces=[Landroid.os.Parcelable;@40f9e3b0]

D/ProMeasure2DActivity( 1529): open SUCCESS

D/UsbRequestJNI( 1529): init

D/ViewRootImpl( 1529): pckname = com.android.missilelauncher

I/Process ( 167): Sending signal. PID: 1529 SIG: 3

I/dalvikvm( 1529): threadid=3: reacting to signal 3

D/dalvikvm( 1529): threadid=11: still suspended after undo (sc=1 dc=1)

I/dalvikvm( 1529): Wrote stack traces to ‘/data/anr/traces.txt’

I/ActivityManager( 167): Displayed
com.android.missilelauncher/.MissileLauncherActivity: +3s791ms

I/ActivityManager( 167): No longer want com.android.email (pid 1266):
hidden #16

D/Finsky ( 696): [1] 5.onFinished: Installation state replication
succeeded.

  • 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-06-17T10:19:40+00:00Added an answer on June 17, 2026 at 10:19 am

    Based on research I did after I read Luksprog’s comment, here is the actual code solution that seems to work:

    1. Remove znum = (TextView) findViewById(R.id.tvZnum); from my OnCreate.
    2. Replace znum.setText(“help”); with this code:

              this.runOnUiThread(new Runnable() {
                  public void run() {
                      ((TextView) findViewById(R.id.tvZnum)).setText("help");
                  }
              });
      

      I believe the result of this is to add the setText action to a queue in the main UI thread.

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

Sidebar

Related Questions

I have a Java program that processes one file at a time. This Java
I have created a small program which logs text data to a file on
I have a IO intensive simulation program, that logs the simulation trace / data
I have some code that will load full file names (ex.F:\logs\1234.log) into a listbox
I have a program that logs it's progress and other data to an XML
I have a program that put logs into a .txt file, updating them regularly
I do have a program which logs some specific events in a text file
I have a program that gets a JSON from the server using getJSON and
I have a program that reads from a file that grabs 4 bytes from
I have a program that is used to create other program and compile it

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.