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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T08:53:10+00:00 2026-05-27T08:53:10+00:00

I am getting the error ‘Unable to open stack trace file ‘/data/anr/traces.txt’: Permission denied’

  • 0

I am getting the error ‘Unable to open stack trace file ‘/data/anr/traces.txt’: Permission denied’ which I know has somthing to do with error in the logic; the issue is my xml files are spic and span, therefore I assume it must be by activity class.

I have a main layout (main.xml) which has the buttons: ‘start’ and ‘instructions’. When clicking the instructions button it should go to the layout: instructions.xml and when clicking the start button it should go to the layout: test_layout.xml.

For any insight what so ever I would be most grateful and pour millions of reputation on you. Thanks.

-Is the issue that I am implementing the OnClickListener ?

-Is it something to do not putting a @Override on top of the second method (‘public void onClick’)? because it says that I can only place it when overwriting a super class.**

Please, it very short code, I could appreciate if you could take a quick glance and tell me what you think. I posted the manifest bellow the code.

package it.will.work;

import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;



public class ActualWorkingQuizActivity extends Activity implements OnClickListener{


 Button start = (Button) findViewById(it.will.work.R.id.start_main);
 Button instructions = (Button) findViewById(it.will.work.R.id.instructions_main);


    /* Called when the activity is first created. */
       @Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);


     //sets the Click Listeners
    start.setOnClickListener(this);
    instructions.setOnClickListener(this); 

}

public void onClick(View v) {
     if (v==start) {
         setContentView(it.will.work.R.layout.test_layout);
     }
     else if (v==instructions) {
         setContentView(it.will.work.R.layout.instructions);
}
     }
     }

Here is my manifest.

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
   package="it.will.work"
   android:versionCode="1"
   android:versionName="1.0" >

   <uses-sdk android:minSdkVersion="7" />

   <application
       android:icon="@drawable/starwarsicon"
       android:label="@string/appname" >
       <activity
           android:label="@string/appname"
           android:name=".ActualWorkingQuizActivity" >
           <intent-filter >
               <action android:name="android.intent.action.MAIN" />
               <category android:name="android.intent.category.LAUNCHER" />
           </intent-filter>
       </activity>
   </application>

  • 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-27T08:53:10+00:00Added an answer on May 27, 2026 at 8:53 am

    Initialize your Buttons in onCreate().

    start = (Button) findViewById(R.id.start_main);
    instructions = (Button) findViewById(R.id.instructions_main);
    

    In onClick() method make changes like this

    public void onClick(View v)
    {
        if (v.getId() == R.id.start_main)
        {
          setContentView(R.layout.test_layout);
        } else if (v.getId() == R.id.instructions_main)
        {
          setContentView(R.layout.instructions);
        }
    }
    

    Or Alternate

    public void onClick(View v)
    {
        if (v.equals(start))
        {
          setContentView(R.layout.test_layout);
        } else if (v.equals(instructions))
        {
          setContentView(R.layout.instructions);
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

getting error like deny Write-File-Data While Adding the data into Sqlite. I am running
I am getting error ( JVM Error 545 incompatible or corrupt file system )
I'm getting error: Connection must be valid and open when I start this program.
I am getting error as mentioned below: The process cannot access file E:\TempPDFs\Sample.pdf because
I am getting error int pocet = int.Parse(textBox1.Text); It says that data have some
I am getting error no match for operator==in__first. Here is the code: header file:
Getting error while run the checkBox item renderer in advanced datagrid with out data.
I am getting the above mentioned error when my web service tries to open
getting error while try to start service
I am getting error trying to run my asp code for executing stored proc.

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.