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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T23:11:17+00:00 2026-05-30T23:11:17+00:00

So, my app reads Data from the text view and then saves it to

  • 0

So, my app reads Data from the text view and then saves it to a file. Anyway, when I press the submit button it crashes. I have no idea, why, I tried deleting sketchy code, but that didn’t work either.

Anyway, if you could take a look at my code and see what I did wrong, that would be great; also if anyone knows how to copy the LogCat, that would be super cool.

My Code:

@Override
protected void onCreate(Bundle savedInstanceState) {
    // TODO Auto-generated method stub
    super.onCreate(savedInstanceState);
    setContentView(R.layout.login);
    send = (Button) findViewById(R.id.bLogIn);
    user = (EditText) findViewById(R.id.eTuser);
    pass = (EditText) findViewById(R.id.eTpassword);
    staySignedIn = (CheckBox) findViewById(R.id.Cbstay);
    send.setOnClickListener(this);
    try {
        Fos = openFileOutput(FILENAME, Context.MODE_PRIVATE);
        Fos.close();
    } catch (FileNotFoundException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    } catch (IOException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    }

    if (staySignedIn.isChecked()) {

        String u = user.getText().toString();
        String p = pass.getText().toString();
        File f = new File(FILENAME);
        try {
            Fos = new FileOutputStream(f);
            //Write some Data
            Fos.close();
        } catch (FileNotFoundException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        } catch (IOException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        } 


    } 

}

public void onClick(View v) {
    // TODO Auto-generated method stub
    switch (v.getId()) {
    case R.id.bLogIn:
        if (pass.length() == 0)
            Toast.makeText(this,
                    "Try to type in your username and password again!",
                    Toast.LENGTH_LONG).show();
        else if (user.length() == 0)
            Toast.makeText(this,
                    "Try to type in your username and password again!",
                    Toast.LENGTH_LONG).show();
        else {

            String u = user.getText().toString();
            String p = pass.getText().toString();
            Bundle send = new Bundle();
            send.putString("key", u);
            send.putString("key", p);
            Intent a = new Intent(LogIn.this, logincheck.class);
            startActivity(a);
            Toast.makeText(this, "Were signing you in!", Toast.LENGTH_LONG)
                    .show();
            break;
        }
    }

}

}

The Logcat:

 01-19 07:02:42.341: W/System.err(3074): java.io.FileNotFoundException: /userandpass (Read-only file system)
    01-19 07:02:42.341: W/System.err(3074):         at   org.apache.harmony.luni.platform.OSFileSystem.openImpl(Native Method)
    01-19 07:02:42.341: W/System.err(3074):         at   org.apache.harmony.luni.platform.OSFileSystem.open(OSFileSystem.java:152)
    01-19 07:02:42.341: W/System.err(3074):         at java.io.FileOutputStream.<init>(FileOutputStream.java:97)
    01-19 07:02:42.341: W/System.err(3074):         at java.io.FileOutputStream.<init>(FileOutputStream.java:69)
    01-19 07:02:42.341: W/System.err(3074):         at com.gta5news.bananaphone.LogIn.onCreate(LogIn.java:59)
    01-19 07:02:42.341: W/System.err(3074):         at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
01-19 07:02:42.341: W/System.err(3074):         at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627)
01-19 07:02:42.341: W/System.err(3074):         at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)
01-19 07:02:42.341: W/System.err(3074):         at android.app.ActivityThread.access$2300(ActivityThread.java:125)
01-19 07:02:42.351: W/System.err(3074):         at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)
01-19 07:02:42.351: W/System.err(3074):         at android.os.Handler.dispatchMessage(Handler.java:99)
01-19 07:02:42.351: W/System.err(3074):         at android.os.Looper.loop(Looper.java:123)
01-19 07:02:42.351: W/System.err(3074):         at android.app.ActivityThread.main(ActivityThread.java:4627)
01-19 07:02:42.351: W/System.err(3074):         at java.lang.reflect.Method.invokeNative(Native Method)
01-19 07:02:42.351: W/System.err(3074):         at java.lang.reflect.Method.invoke(Method.java:521)
01-19 07:02:42.351: W/System.err(3074):         at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
01-19 07:02:42.351: W/System.err(3074):         at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
01-19 07:02:42.351: W/System.err(3074):         at dalvik.system.NativeStart.main(Native Method)
01-19 07:02:47.371: W/KeyCharacterMap(3074): No keyboard for id 0
01-19 07:02:47.371: W/KeyCharacterMap(3074): Using default keymap: /system/usr/keychars/qwerty.kcm.bin
01-19 07:02:49.421: D/AndroidRuntime(3074): Shutting down VM
01-19 07:02:49.421: W/dalvikvm(3074): threadid=1: thread exiting with uncaught exception (group=0x4001d800)
01-19 07:02:49.421: E/AndroidRuntime(3074): FATAL EXCEPTION: main
01-19 07:02:49.421: E/AndroidRuntime(3074): android.content.ActivityNotFoundException: Unable to find explicit activity class {com.gta5news.bananaphone/com.gta5news.bananaphone.logincheck}; have you declared this activity in your AndroidManifest.xml?
01-19 07:02:49.421: E/AndroidRuntime(3074):     at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:1404)
01-19 07:02:49.421: E/AndroidRuntime(3074):     at android.app.Instrumentation.execStartActivity(Instrumentation.java:1378)
01-19 07:02:49.421: E/AndroidRuntime(3074):     at android.app.Activity.startActivityForResult(Activity.java:2817)
01-19 07:02:49.421: E/AndroidRuntime(3074):     at android.app.Activity.startActivity(Activity.java:2923)
01-19 07:02:49.421: E/AndroidRuntime(3074):     at com.gta5news.bananaphone.LogIn.onClick(LogIn.java:95)
01-19 07:02:49.421: E/AndroidRuntime(3074):     at android.view.View.performClick(View.java:2408)
01-19 07:02:49.421: E/AndroidRuntime(3074):     at android.view.View$PerformClick.run(View.java:8816)
01-19 07:02:49.421: E/AndroidRuntime(3074):     at android.os.Handler.handleCallback(Handler.java:587)
01-19 07:02:49.421: E/AndroidRuntime(3074):     at android.os.Handler.dispatchMessage(Handler.java:92)
01-19 07:02:49.421: E/AndroidRuntime(3074):     at android.os.Looper.loop(Looper.java:123)
01-19 07:02:49.421: E/AndroidRuntime(3074):     at android.app.ActivityThread.main(ActivityThread.java:4627)
01-19 07:02:49.421: E/AndroidRuntime(3074):     at java.lang.reflect.Method.invokeNative(Native Method)
01-19 07:02:49.421: E/AndroidRuntime(3074):     at java.lang.reflect.Method.invoke(Method.java:521)
01-19 07:02:49.421: E/AndroidRuntime(3074):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
01-19 07:02:49.421: E/AndroidRuntime(3074):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
01-19 07:02:49.421: E/AndroidRuntime(3074):     at dalvik.system.NativeStart.main(Native Method)
  • 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-30T23:11:19+00:00Added an answer on May 30, 2026 at 11:11 pm

    if you looked at the logs the answer is in it. Check the line

    E/AndroidRuntime(3074): android.content.ActivityNotFoundException: Unable to find explicit activity class {com.gta5news.bananaphone/com.gta5news.bananaphone.logincheck}; have you declared this activity in your AndroidManifest.xml?
    

    It says that you did not declare your new activity which you are trying to open on your button click in the manifest. Add it to your manifest and it should work fine.

    It is trying to find your logincheck class in the manifest.

    And as a side note try to follow java conventions. use camel casing for class names and such. for example your class should be names as LoginCheck. More on java conventions here.

    Your manifest should already have an activity tag. under it add your new activity like this

    <activity name="com.gta5news.bananaphone.logincheck" />
    

    That should do it.

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

Sidebar

Related Questions

I have application reads in data from text file. Recently I realized that I
I have an HTML (App) file that reads another HTML (data) file via jQuery.ajax()
I have successfully created an app that reads from a bundled .plist file and
I'm working on a web app that reads data from a set of text
I am making a simple app that reads data in from a file. So
I am creating an iOS app that reads data from a single SQLITE table
I'm developing an iPhone app. I've got a function that reads data from a
I have an small ASP.NET application that reads data from a table and sends
I worked in android app that read large text file from server (20 MB)
I'm building an app in CppBB6 that reads/writes data from/in a database. From a

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.