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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T12:09:53+00:00 2026-05-15T12:09:53+00:00

some1 post the code for accessing .txt file available in my res folder the

  • 0

some1 post the code for accessing .txt file available in my res folder

the code for which can be written in .java file!!!


This is the LogCat output when i get that error!!

07-01 14:50:20.886: ERROR/AndroidRuntime(257): FATAL EXCEPTION: main
07-01 14:50:20.886: ERROR/AndroidRuntime(257): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{de.vogella.android.test/de.vogella.android.test.test}: java.lang.NullPointerException
07-01 14:50:20.886: ERROR/AndroidRuntime(257): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2585)
07-01 14:50:20.886: ERROR/AndroidRuntime(257): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)
07-01 14:50:20.886: ERROR/AndroidRuntime(257): at android.app.ActivityThread.access$2300(ActivityThread.java:125)
07-01 14:50:20.886: ERROR/AndroidRuntime(257): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)
07-01 14:50:20.886: ERROR/AndroidRuntime(257): at android.os.Handler.dispatchMessage(Handler.java:99)
07-01 14:50:20.886: ERROR/AndroidRuntime(257): at android.os.Looper.loop(Looper.java:123)
07-01 14:50:20.886: ERROR/AndroidRuntime(257): at android.app.ActivityThread.main(ActivityThread.java:4627)
07-01 14:50:20.886: ERROR/AndroidRuntime(257): at java.lang.reflect.Method.invokeNative(Native Method)
07-01 14:50:20.886: ERROR/AndroidRuntime(257): at java.lang.reflect.Method.invoke(Method.java:521)
07-01 14:50:20.886: ERROR/AndroidRuntime(257): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
07-01 14:50:20.886: ERROR/AndroidRuntime(257): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
07-01 14:50:20.886: ERROR/AndroidRuntime(257): at dalvik.system.NativeStart.main(Native Method)
07-01 14:50:20.886: ERROR/AndroidRuntime(257): Caused by: java.lang.NullPointerException
07-01 14:50:20.886: ERROR/AndroidRuntime(257): at de.vogella.android.test.test.(test.java:55)
07-01 14:50:20.886: ERROR/AndroidRuntime(257): at java.lang.Class.newInstanceImpl(Native Method)
07-01 14:50:20.886: ERROR/AndroidRuntime(257): at java.lang.Class.newInstance(Class.java:1429)
07-01 14:50:20.886: ERROR/AndroidRuntime(257): at android.app.Instrumentation.newActivity(Instrumentation.java:1021)

  • 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-15T12:09:53+00:00Added an answer on May 15, 2026 at 12:09 pm

    You can put the file in your assets folder and then open it to read like you would in any other Java program.

    Example here.

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

Sidebar

Related Questions

I have some code like this: [AcceptVerbs(HttpVerbs.Post)] public ActionResult Save([Bind(Prefix=)]Person person) { String s
I have asked this question in a different post here on SO: How can
I'm trying to post some code on a blog using the pre tag. Something
Does anyone have some sample code showing how to POST to a URL using
I got some sample code from the net here: http://www.javadb.com/sending-a-post-request-with-parameters-from-a-java-class That works fine. It
I am trying to get some form data from POST method. Here's the code
Can some one post an example of using syslog outputter for log4r, I am
this is an extension of my previous thread . I thought that accessing a
IS there a way to post a $var to $PHP_SELF so that I can
i am having one form accepting json post in Asp.net which i need to

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.