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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T22:12:26+00:00 2026-06-13T22:12:26+00:00

I followed the example at Help with passing ArrayList and parcelable Activity but for

  • 0

I followed the example at Help with passing ArrayList and parcelable Activity but for my case i’m trying to broadcast an intent from my Service class (Inside Asynctask) to Activity class like this.

ArrayList<Malware> addyExtras = new ArrayList <Malware>();

for (int i = 0; i < fetch.size(); i++) {
    addyExtras.add (fetch.get(i));
}
Intent d = new Intent();
d.setAction(COMPLETED_INTENT);
d.putExtra("CurrentProgress", "completed");
d.putParcelableArrayListExtra("MalwareArray", addyExtras);
sendBroadcast(d);

How i receive the broadcast intent

ArrayList<Malware> myList;
myList = getIntent().getParcelableArrayListExtra("MalwareArray");
Log.d("onReceive", "got myList");

for (int i = 0; i < myList.size(); i++) {
    Malware a = myList.get(i);
    Log.d("onReceive", "App Name:" + a.getApp());
    //tv1.setText(a.getName() + " is from " + a.getState());
}

It hits a nullpointerexception when trying to receive the intent

11-07 01:21:51.315: E/AndroidRuntime(18769): FATAL EXCEPTION: main
11-07 01:21:51.315: E/AndroidRuntime(18769): java.lang.RuntimeException: Error receiving broadcast Intent { act=com.analyze.project.CompletedReceiver flg=0x10 (has extras) } in com.analyze.project.AnalyzeActivity$1@41889670
11-07 01:21:51.315: E/AndroidRuntime(18769):    at android.app.LoadedApk$ReceiverDispatcher$Args.run(LoadedApk.java:737)
11-07 01:21:51.315: E/AndroidRuntime(18769):    at android.os.Handler.handleCallback(Handler.java:605)
11-07 01:21:51.315: E/AndroidRuntime(18769):    at android.os.Handler.dispatchMessage(Handler.java:92)
11-07 01:21:51.315: E/AndroidRuntime(18769):    at android.os.Looper.loop(Looper.java:137)
11-07 01:21:51.315: E/AndroidRuntime(18769):    at android.app.ActivityThread.main(ActivityThread.java:4513)
11-07 01:21:51.315: E/AndroidRuntime(18769):    at java.lang.reflect.Method.invokeNative(Native Method)
11-07 01:21:51.315: E/AndroidRuntime(18769):    at java.lang.reflect.Method.invoke(Method.java:511)
11-07 01:21:51.315: E/AndroidRuntime(18769):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:974)
11-07 01:21:51.315: E/AndroidRuntime(18769):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:741)
11-07 01:21:51.315: E/AndroidRuntime(18769):    at dalvik.system.NativeStart.main(Native Method)
11-07 01:21:51.315: E/AndroidRuntime(18769): Caused by: java.lang.NullPointerException
11-07 01:21:51.315: E/AndroidRuntime(18769):    at com.analyze.project.AnalyzeActivity$1.onReceive(AnalyzeActivity.java:197)
11-07 01:21:51.315: E/AndroidRuntime(18769):    at android.app.LoadedApk$ReceiverDispatcher$Args.run(LoadedApk.java:728)
11-07 01:21:51.315: E/AndroidRuntime(18769):    ... 9 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-13T22:12:27+00:00Added an answer on June 13, 2026 at 10:12 pm

    from the log, AnalyzeActivity.java:197, you have a variable that is, unexpectedly, null on line 197.

    private BroadcastReceiver mMessageReceiver = new BroadcastReceiver() {
    @Override
    public void onReceive(Context context, Intent intent) {
    
        Log.d("TAG", "onReceive1()");
        //setIntent(intent);
    
        ArrayList<Malware> myList;
        // use local var intent 
        myList = intent.getParcelableArrayListExtra("MalwareArray");
        Log.d("onReceive", "got myList");
    
        for (int i = 0; i < myList.size(); i++) {
            Malware a = myList.get(i);
            Log.d("onReceive", "App Name:" + a.getApp());
            //tv1.setText(a.getName() + " is from " + a.getState());
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have followed the Local Service example provided by Google, but my Context::bindService(...) always
I have got a theme downloaded from http://template-help.com . I have followed the instruction
I'm trying to encrypt a String using TripleDESEncryption and followed this example I found
Ive been trying to get an example Web Service working using SpringWS and Tomcat5.5
I've followed this example: RCP+JavaWS but the app just briefly comes up and goes
I followed the example given in ember application stucture guide http://emberjs.com/guides/outlets/ in order to
I'm doing an xpinc application. I followed the example in here and modified it.
I want to replace char '&' if it's not followed by '#'. For example
Followed this question about delayed_job and monit Its working on my development machine. But
I followed the instructions on source.android.com to build the Android framework, but when I

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.