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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T20:28:34+00:00 2026-05-15T20:28:34+00:00

The same code that displays the lists running on the emulator doesn’t run on

  • 0

The same code that displays the lists running on the emulator doesn’t run on the mobile (Motorola Milestone). I’m using the same android platform (2.1-update).

Inbox Code

private ArrayList<EmailModel> email_list;


private EmailAdapter email_adapter;

 @Override
 public void onCreate(Bundle savedInstanceState) {

  super.onCreate(savedInstanceState);

  try {
   this.email_list = populate_list();
   email_adapter = new EmailAdapter(this, email_list);
   setListAdapter(email_adapter);

  } catch (Exception e) {
   Log.v("Inbox", "Adapting Problem: " + e.toString());
  }
 }

EmailAdapter Code

public class EmailAdapter extends BaseAdapter {



private ArrayList<EmailModel> elements;
private Context c;

public EmailAdapter(Context c, ArrayList<EmailModel> Emails) {

 this.elements = Emails;
    this.c = c;
}
public int getCount() {

    return elements.size();
}

public Object getItem(int position) {

    return elements.get(position);
}

public long getItemId(int id) {

    return id;
}

public void Remove(int id) {
    notifyDataSetChanged();
}

public void Add(EmailModel email) {

 this.elements.add(email);

 notifyDataSetChanged();
}

public View getView(int position, View convertView, ViewGroup parent) {

    LinearLayout rowLayout;
    EmailModel email = elements.get(position);

    if (convertView == null) {
     rowLayout = (LinearLayout) LayoutInflater.from(c).inflate(R.layout.inbox_item, parent, false); 
    } else {
        rowLayout = (LinearLayout) convertView;
    }

 TextView subject_textview = (TextView)rowLayout.findViewById(R.id.subject_textview);
 subject_textview.setText(email.getSubject());

 String body_hint = " - " + email.getBodyHint();

 TextView bodyhint_textview = (TextView)rowLayout.findViewById(R.id.body_hint_textview);
 bodyhint_textview.setText(body_hint);


 String sender_name = get_sender_name(email.getSender());

 TextView sender_name_textview = (TextView)rowLayout.findViewById(R.id.sender_textview);
 sender_name_textview.setText(sender_name);

 TextView date_time_textview = (TextView)rowLayout.findViewById(R.id.date_time_textview); 
 date_time_textview.setText(email.getTime());


    return rowLayout;
}

private String get_sender_name(String from) {

 String[] sender = from.split("<");


String sender_name;

  try {
   sender_name = sender[0];
  } catch (Exception e) {
   sender_name = sender[1];
  }
  return sender_name;
    }}

exception output

07-16 13:15:21.190: VERBOSE/Inbox(429): Adapting Problem: java.lang.ArrayIndexOutOfBoundsException

Stack Trace

07-16 14:00:49.690: WARN/System.err(703): java.lang.ArrayIndexOutOfBoundsException
07-16 14:00:49.698: WARN/System.err(703): at com.anubis.mail.Inbox.populate_list(Inbox.java:237)
07-16 14:00:49.698: WARN/System.err(703): at com.anubis.mail.Inbox.onCreate(Inbox.java:69)
07-16 14:00:49.698: WARN/System.err(703): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
07-16 14:00:49.698: WARN/System.err(703): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2459)
07-16 14:00:49.706: WARN/System.err(703): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2512)
07-16 14:00:49.706: WARN/System.err(703): at android.app.ActivityThread.access$2200(ActivityThread.java:119)
07-16 14:00:49.706: WARN/System.err(703): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1863)
07-16 14:00:49.706: WARN/System.err(703): at android.os.Handler.dispatchMessage(Handler.java:99)
07-16 14:00:49.706: WARN/System.err(703): at android.os.Looper.loop(Looper.java:123)
07-16 14:00:49.706: WARN/System.err(703): at android.app.ActivityThread.main(ActivityThread.java:4363)
07-16 14:00:49.706: WARN/System.err(703): at java.lang.reflect.Method.invokeNative(Native Method)
07-16 14:00:49.706: WARN/System.err(703): at java.lang.reflect.Method.invoke(Method.java:521)
07-16 14:00:49.706: WARN/System.err(703): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)
07-16 14:00:49.706: WARN/System.err(703): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)
07-16 14:00:49.706: WARN/System.err(703): 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-15T20:28:35+00:00Added an answer on May 15, 2026 at 8:28 pm

    The stack trace tells us that this Exception is occuring on line 237 of Inbox.java in your method populate_list(). This is not an issue with your adaptor. Since you’ve not provided the source code for populate_list method, we can’t tell you precisely what the issue is.

    So, look at line 237 of Inbox.java!

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

Sidebar

Ask A Question

Stats

  • Questions 459k
  • Answers 459k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Given this input: private static void ForLoop() { int n… May 15, 2026 at 11:33 pm
  • Editorial Team
    Editorial Team added an answer ## load the file from disk only if it ##… May 15, 2026 at 11:33 pm
  • Editorial Team
    Editorial Team added an answer I wrote a series of articles on The Code Project… May 15, 2026 at 11:33 pm

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.