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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T06:21:36+00:00 2026-06-04T06:21:36+00:00

Hi every one I’m stuck with doing a simple call to a function. This

  • 0

Hi every one I’m stuck with doing a simple call to a function. This is my first android app I’m from iPhone. Each time I’m doing something in the onCreate() my app crash.. I’m sure the problem is very simple

public class AndroidReaderActivity extends Activity {

    public void test(){
        File dir=new File("/assets");
        String[] listefichiers;
        int i;
        listefichiers = dir.list();
        for (i = 0; i < listefichiers.length; i++) {
            System.out.println(listefichiers[i]);
        }
    }
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        test();        
    }
}

Thanks you for your help.

Edit:
Here are the Cat LOG

05-15 19:52:55.710: E/AndroidRuntime(1956): FATAL EXCEPTION: main
05-15 19:52:55.710: E/AndroidRuntime(1956): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.infotel/com.infotel.AndroidReaderActivity}: java.lang.NullPointerException
05-15 19:52:55.710: E/AndroidRuntime(1956):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1956)
05-15 19:52:55.710: E/AndroidRuntime(1956):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1981)
05-15 19:52:55.710: E/AndroidRuntime(1956):     at android.app.ActivityThread.access$600(ActivityThread.java:123)
05-15 19:52:55.710: E/AndroidRuntime(1956):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1147)
05-15 19:52:55.710: E/AndroidRuntime(1956):     at android.os.Handler.dispatchMessage(Handler.java:99)
05-15 19:52:55.710: E/AndroidRuntime(1956):     at android.os.Looper.loop(Looper.java:137)
05-15 19:52:55.710: E/AndroidRuntime(1956):     at android.app.ActivityThread.main(ActivityThread.java:4424)
05-15 19:52:55.710: E/AndroidRuntime(1956):     at java.lang.reflect.Method.invokeNative(Native Method)
05-15 19:52:55.710: E/AndroidRuntime(1956):     at java.lang.reflect.Method.invoke(Method.java:511)
05-15 19:52:55.710: E/AndroidRuntime(1956):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
05-15 19:52:55.710: E/AndroidRuntime(1956):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
05-15 19:52:55.710: E/AndroidRuntime(1956):     at dalvik.system.NativeStart.main(Native Method)
05-15 19:52:55.710: E/AndroidRuntime(1956): Caused by: java.lang.NullPointerException
05-15 19:52:55.710: E/AndroidRuntime(1956):     at com.infotel.AndroidReaderActivity.test(AndroidReaderActivity.java:14)
05-15 19:52:55.710: E/AndroidRuntime(1956):     at com.infotel.AndroidReaderActivity.onCreate(AndroidReaderActivity.java:23)
05-15 19:52:55.710: E/AndroidRuntime(1956):     at android.app.Activity.performCreate(Activity.java:4465)
05-15 19:52:55.710: E/AndroidRuntime(1956):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1049)
05-15 19:52:55.710: E/AndroidRuntime(1956):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1920)
05-15 19:52:55.710: E/AndroidRuntime(1956):     ... 11 more
  • 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-04T06:21:38+00:00Added an answer on June 4, 2026 at 6:21 am

    It depends on what you’re trying to do. If you are trying to list files in a directory, here is a post that describes how to do that:

    How to list files in an android directory?

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

Sidebar

Related Questions

every one i am using EKEventStore to add events into iphone calender from my
hey every one I want to alert value of n from this string $('.orbit-bullets:has(
hiii every one i am new to iphone development in a sample downloaded app
Hey every one i am programming an iphone app to get google search results
every one. I'm developing iphone app. I try to change the Button's title in
Hello every one I want to ask a question that what is simple exec
Hello every one I have wrote a simple code in html5 in which I
Hello every one I have made a small function which takes a pointer to
Hello every one this is extension to my previous question.Here is the link File
Hi every one first of all im new in zend and i need some

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.