'java.lang.String[] android.os.Bundle.getStringArray(java.lang.String)'










0















I am trying to fetch checked listview items from pending activity to allowed_to activity. Here is my code :



pending.java



 button.setOnClickListener(new View.OnClickListener() 
@Override
public void onClick(View v)

SparseBooleanArray checked = listView.getCheckedItemPositions();
ArrayList<String> selectedItems = new ArrayList<String>();
String str = null;
for (int i = 0; i < checked.size(); i++)
int position;
position = checked.keyAt(i);
if (checked.valueAt(i))
selectedItems.add(String.valueOf(arrayAdapter.getItem(position)));
str = listView.getItemAtPosition(i).toString();
if(ContextCompat.checkSelfPermission(getApplicationContext(),Manifest.permission.SEND_SMS)
!= PackageManager.PERMISSION_GRANTED)

ActivityCompat.requestPermissions(pending.this,new StringManifest.permission.SEND_SMS,MY_PERMISSIONS_REQUEST_SEND_SMS );

else

SmsManager sms = SmsManager.getDefault();
sms.sendTextMessage(str,null,"#def",null,null);
Toast.makeText(getApplicationContext(), "Affirmation sent !!",
Toast.LENGTH_SHORT).show();



String StrArr = new String[selectedItems.size()];

for (int i = 0; i < selectedItems.size(); i++)
StrArr[i] = selectedItems.get(i);


Intent intent = new Intent(getApplicationContext(),
allowed_to.class);
b = new Bundle();
b.putStringArray("nibba", StrArr);
intent.putExtras(b);
startActivity(intent);
arrayAdapter.remove(str);


);


allowed_to.java



public class allowed_to extends pending 
public static String resultArr;

public static ListView lvl;
@Override
protected void onCreate(Bundle savedInstanceState)
super.onCreate(savedInstanceState);
setContentView(R.layout.allowed_to);


Bundle bundle = getIntent().getExtras();


resultArr = bundle.getStringArray("nibba");

lvl = (ListView) findViewById(R.id.lv);
ArrayAdapter<String> adapter = new ArrayAdapter<String>(this,
android.R.layout.simple_list_item_1, resultArr);
lvl.setAdapter(adapter);
Toast.makeText(getApplicationContext(), "Allowed successfully !!",
Toast.LENGTH_SHORT).show();






But whenever I open the app, I get this error and my app crashes.



logcat



11-14 19:55:21.782 28136-28136/com.nevermiss.subhamdutta.nevermiss E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.nevermiss.subhamdutta.nevermiss, PID: 28136
java.lang.RuntimeException: Unable to start activity ComponentInfocom.nevermiss.subhamdutta.nevermiss/com.nevermiss.subhamdutta.nevermiss.allowed_to: java.lang.NullPointerException: **Attempt to invoke virtual method 'java.lang.String android.os.Bundle.getStringArray(java.lang.String)' on a null object reference**
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2434)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2494)
at android.app.ActivityThread.access$900(ActivityThread.java:153)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1347)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5451)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)


Update: I also tried checking putting an if statement as follows:



package com.nevermiss.subhamdutta.nevermiss;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.widget.ArrayAdapter;
import android.widget.ListView;
import android.widget.Toast;

import java.util.ArrayList;

import static android.R.attr.data;

public class allowed_to extends pending
public static String resultArr;

public static ListView lvl;
@Override
protected void onCreate(Bundle savedInstanceState)
super.onCreate(savedInstanceState);
setContentView(R.layout.allowed_to);


Bundle bundle = getIntent().getExtras();
if(bundle != null)

resultArr = bundle.getStringArray("nibba");

lvl = (ListView) findViewById(R.id.lv);
ArrayAdapter<String> adapter = new ArrayAdapter<String>(this,
android.R.layout.simple_list_item_1, resultArr);
lvl.setAdapter(adapter);
Toast.makeText(getApplicationContext(), "Allowed successfully !!",
Toast.LENGTH_SHORT).show();






Fortunately the app opens up, but the listview is completely empty. How do I view those listview items?










share|improve this question




























    0















    I am trying to fetch checked listview items from pending activity to allowed_to activity. Here is my code :



    pending.java



     button.setOnClickListener(new View.OnClickListener() 
    @Override
    public void onClick(View v)

    SparseBooleanArray checked = listView.getCheckedItemPositions();
    ArrayList<String> selectedItems = new ArrayList<String>();
    String str = null;
    for (int i = 0; i < checked.size(); i++)
    int position;
    position = checked.keyAt(i);
    if (checked.valueAt(i))
    selectedItems.add(String.valueOf(arrayAdapter.getItem(position)));
    str = listView.getItemAtPosition(i).toString();
    if(ContextCompat.checkSelfPermission(getApplicationContext(),Manifest.permission.SEND_SMS)
    != PackageManager.PERMISSION_GRANTED)

    ActivityCompat.requestPermissions(pending.this,new StringManifest.permission.SEND_SMS,MY_PERMISSIONS_REQUEST_SEND_SMS );

    else

    SmsManager sms = SmsManager.getDefault();
    sms.sendTextMessage(str,null,"#def",null,null);
    Toast.makeText(getApplicationContext(), "Affirmation sent !!",
    Toast.LENGTH_SHORT).show();



    String StrArr = new String[selectedItems.size()];

    for (int i = 0; i < selectedItems.size(); i++)
    StrArr[i] = selectedItems.get(i);


    Intent intent = new Intent(getApplicationContext(),
    allowed_to.class);
    b = new Bundle();
    b.putStringArray("nibba", StrArr);
    intent.putExtras(b);
    startActivity(intent);
    arrayAdapter.remove(str);


    );


    allowed_to.java



    public class allowed_to extends pending 
    public static String resultArr;

    public static ListView lvl;
    @Override
    protected void onCreate(Bundle savedInstanceState)
    super.onCreate(savedInstanceState);
    setContentView(R.layout.allowed_to);


    Bundle bundle = getIntent().getExtras();


    resultArr = bundle.getStringArray("nibba");

    lvl = (ListView) findViewById(R.id.lv);
    ArrayAdapter<String> adapter = new ArrayAdapter<String>(this,
    android.R.layout.simple_list_item_1, resultArr);
    lvl.setAdapter(adapter);
    Toast.makeText(getApplicationContext(), "Allowed successfully !!",
    Toast.LENGTH_SHORT).show();






    But whenever I open the app, I get this error and my app crashes.



    logcat



    11-14 19:55:21.782 28136-28136/com.nevermiss.subhamdutta.nevermiss E/AndroidRuntime: FATAL EXCEPTION: main
    Process: com.nevermiss.subhamdutta.nevermiss, PID: 28136
    java.lang.RuntimeException: Unable to start activity ComponentInfocom.nevermiss.subhamdutta.nevermiss/com.nevermiss.subhamdutta.nevermiss.allowed_to: java.lang.NullPointerException: **Attempt to invoke virtual method 'java.lang.String android.os.Bundle.getStringArray(java.lang.String)' on a null object reference**
    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2434)
    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2494)
    at android.app.ActivityThread.access$900(ActivityThread.java:153)
    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1347)
    at android.os.Handler.dispatchMessage(Handler.java:102)
    at android.os.Looper.loop(Looper.java:148)
    at android.app.ActivityThread.main(ActivityThread.java:5451)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)


    Update: I also tried checking putting an if statement as follows:



    package com.nevermiss.subhamdutta.nevermiss;

    import android.app.Activity;
    import android.content.Intent;
    import android.os.Bundle;
    import android.widget.ArrayAdapter;
    import android.widget.ListView;
    import android.widget.Toast;

    import java.util.ArrayList;

    import static android.R.attr.data;

    public class allowed_to extends pending
    public static String resultArr;

    public static ListView lvl;
    @Override
    protected void onCreate(Bundle savedInstanceState)
    super.onCreate(savedInstanceState);
    setContentView(R.layout.allowed_to);


    Bundle bundle = getIntent().getExtras();
    if(bundle != null)

    resultArr = bundle.getStringArray("nibba");

    lvl = (ListView) findViewById(R.id.lv);
    ArrayAdapter<String> adapter = new ArrayAdapter<String>(this,
    android.R.layout.simple_list_item_1, resultArr);
    lvl.setAdapter(adapter);
    Toast.makeText(getApplicationContext(), "Allowed successfully !!",
    Toast.LENGTH_SHORT).show();






    Fortunately the app opens up, but the listview is completely empty. How do I view those listview items?










    share|improve this question


























      0












      0








      0








      I am trying to fetch checked listview items from pending activity to allowed_to activity. Here is my code :



      pending.java



       button.setOnClickListener(new View.OnClickListener() 
      @Override
      public void onClick(View v)

      SparseBooleanArray checked = listView.getCheckedItemPositions();
      ArrayList<String> selectedItems = new ArrayList<String>();
      String str = null;
      for (int i = 0; i < checked.size(); i++)
      int position;
      position = checked.keyAt(i);
      if (checked.valueAt(i))
      selectedItems.add(String.valueOf(arrayAdapter.getItem(position)));
      str = listView.getItemAtPosition(i).toString();
      if(ContextCompat.checkSelfPermission(getApplicationContext(),Manifest.permission.SEND_SMS)
      != PackageManager.PERMISSION_GRANTED)

      ActivityCompat.requestPermissions(pending.this,new StringManifest.permission.SEND_SMS,MY_PERMISSIONS_REQUEST_SEND_SMS );

      else

      SmsManager sms = SmsManager.getDefault();
      sms.sendTextMessage(str,null,"#def",null,null);
      Toast.makeText(getApplicationContext(), "Affirmation sent !!",
      Toast.LENGTH_SHORT).show();



      String StrArr = new String[selectedItems.size()];

      for (int i = 0; i < selectedItems.size(); i++)
      StrArr[i] = selectedItems.get(i);


      Intent intent = new Intent(getApplicationContext(),
      allowed_to.class);
      b = new Bundle();
      b.putStringArray("nibba", StrArr);
      intent.putExtras(b);
      startActivity(intent);
      arrayAdapter.remove(str);


      );


      allowed_to.java



      public class allowed_to extends pending 
      public static String resultArr;

      public static ListView lvl;
      @Override
      protected void onCreate(Bundle savedInstanceState)
      super.onCreate(savedInstanceState);
      setContentView(R.layout.allowed_to);


      Bundle bundle = getIntent().getExtras();


      resultArr = bundle.getStringArray("nibba");

      lvl = (ListView) findViewById(R.id.lv);
      ArrayAdapter<String> adapter = new ArrayAdapter<String>(this,
      android.R.layout.simple_list_item_1, resultArr);
      lvl.setAdapter(adapter);
      Toast.makeText(getApplicationContext(), "Allowed successfully !!",
      Toast.LENGTH_SHORT).show();






      But whenever I open the app, I get this error and my app crashes.



      logcat



      11-14 19:55:21.782 28136-28136/com.nevermiss.subhamdutta.nevermiss E/AndroidRuntime: FATAL EXCEPTION: main
      Process: com.nevermiss.subhamdutta.nevermiss, PID: 28136
      java.lang.RuntimeException: Unable to start activity ComponentInfocom.nevermiss.subhamdutta.nevermiss/com.nevermiss.subhamdutta.nevermiss.allowed_to: java.lang.NullPointerException: **Attempt to invoke virtual method 'java.lang.String android.os.Bundle.getStringArray(java.lang.String)' on a null object reference**
      at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2434)
      at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2494)
      at android.app.ActivityThread.access$900(ActivityThread.java:153)
      at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1347)
      at android.os.Handler.dispatchMessage(Handler.java:102)
      at android.os.Looper.loop(Looper.java:148)
      at android.app.ActivityThread.main(ActivityThread.java:5451)
      at java.lang.reflect.Method.invoke(Native Method)
      at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
      at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)


      Update: I also tried checking putting an if statement as follows:



      package com.nevermiss.subhamdutta.nevermiss;

      import android.app.Activity;
      import android.content.Intent;
      import android.os.Bundle;
      import android.widget.ArrayAdapter;
      import android.widget.ListView;
      import android.widget.Toast;

      import java.util.ArrayList;

      import static android.R.attr.data;

      public class allowed_to extends pending
      public static String resultArr;

      public static ListView lvl;
      @Override
      protected void onCreate(Bundle savedInstanceState)
      super.onCreate(savedInstanceState);
      setContentView(R.layout.allowed_to);


      Bundle bundle = getIntent().getExtras();
      if(bundle != null)

      resultArr = bundle.getStringArray("nibba");

      lvl = (ListView) findViewById(R.id.lv);
      ArrayAdapter<String> adapter = new ArrayAdapter<String>(this,
      android.R.layout.simple_list_item_1, resultArr);
      lvl.setAdapter(adapter);
      Toast.makeText(getApplicationContext(), "Allowed successfully !!",
      Toast.LENGTH_SHORT).show();






      Fortunately the app opens up, but the listview is completely empty. How do I view those listview items?










      share|improve this question
















      I am trying to fetch checked listview items from pending activity to allowed_to activity. Here is my code :



      pending.java



       button.setOnClickListener(new View.OnClickListener() 
      @Override
      public void onClick(View v)

      SparseBooleanArray checked = listView.getCheckedItemPositions();
      ArrayList<String> selectedItems = new ArrayList<String>();
      String str = null;
      for (int i = 0; i < checked.size(); i++)
      int position;
      position = checked.keyAt(i);
      if (checked.valueAt(i))
      selectedItems.add(String.valueOf(arrayAdapter.getItem(position)));
      str = listView.getItemAtPosition(i).toString();
      if(ContextCompat.checkSelfPermission(getApplicationContext(),Manifest.permission.SEND_SMS)
      != PackageManager.PERMISSION_GRANTED)

      ActivityCompat.requestPermissions(pending.this,new StringManifest.permission.SEND_SMS,MY_PERMISSIONS_REQUEST_SEND_SMS );

      else

      SmsManager sms = SmsManager.getDefault();
      sms.sendTextMessage(str,null,"#def",null,null);
      Toast.makeText(getApplicationContext(), "Affirmation sent !!",
      Toast.LENGTH_SHORT).show();



      String StrArr = new String[selectedItems.size()];

      for (int i = 0; i < selectedItems.size(); i++)
      StrArr[i] = selectedItems.get(i);


      Intent intent = new Intent(getApplicationContext(),
      allowed_to.class);
      b = new Bundle();
      b.putStringArray("nibba", StrArr);
      intent.putExtras(b);
      startActivity(intent);
      arrayAdapter.remove(str);


      );


      allowed_to.java



      public class allowed_to extends pending 
      public static String resultArr;

      public static ListView lvl;
      @Override
      protected void onCreate(Bundle savedInstanceState)
      super.onCreate(savedInstanceState);
      setContentView(R.layout.allowed_to);


      Bundle bundle = getIntent().getExtras();


      resultArr = bundle.getStringArray("nibba");

      lvl = (ListView) findViewById(R.id.lv);
      ArrayAdapter<String> adapter = new ArrayAdapter<String>(this,
      android.R.layout.simple_list_item_1, resultArr);
      lvl.setAdapter(adapter);
      Toast.makeText(getApplicationContext(), "Allowed successfully !!",
      Toast.LENGTH_SHORT).show();






      But whenever I open the app, I get this error and my app crashes.



      logcat



      11-14 19:55:21.782 28136-28136/com.nevermiss.subhamdutta.nevermiss E/AndroidRuntime: FATAL EXCEPTION: main
      Process: com.nevermiss.subhamdutta.nevermiss, PID: 28136
      java.lang.RuntimeException: Unable to start activity ComponentInfocom.nevermiss.subhamdutta.nevermiss/com.nevermiss.subhamdutta.nevermiss.allowed_to: java.lang.NullPointerException: **Attempt to invoke virtual method 'java.lang.String android.os.Bundle.getStringArray(java.lang.String)' on a null object reference**
      at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2434)
      at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2494)
      at android.app.ActivityThread.access$900(ActivityThread.java:153)
      at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1347)
      at android.os.Handler.dispatchMessage(Handler.java:102)
      at android.os.Looper.loop(Looper.java:148)
      at android.app.ActivityThread.main(ActivityThread.java:5451)
      at java.lang.reflect.Method.invoke(Native Method)
      at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
      at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)


      Update: I also tried checking putting an if statement as follows:



      package com.nevermiss.subhamdutta.nevermiss;

      import android.app.Activity;
      import android.content.Intent;
      import android.os.Bundle;
      import android.widget.ArrayAdapter;
      import android.widget.ListView;
      import android.widget.Toast;

      import java.util.ArrayList;

      import static android.R.attr.data;

      public class allowed_to extends pending
      public static String resultArr;

      public static ListView lvl;
      @Override
      protected void onCreate(Bundle savedInstanceState)
      super.onCreate(savedInstanceState);
      setContentView(R.layout.allowed_to);


      Bundle bundle = getIntent().getExtras();
      if(bundle != null)

      resultArr = bundle.getStringArray("nibba");

      lvl = (ListView) findViewById(R.id.lv);
      ArrayAdapter<String> adapter = new ArrayAdapter<String>(this,
      android.R.layout.simple_list_item_1, resultArr);
      lvl.setAdapter(adapter);
      Toast.makeText(getApplicationContext(), "Allowed successfully !!",
      Toast.LENGTH_SHORT).show();






      Fortunately the app opens up, but the listview is completely empty. How do I view those listview items?







      android listview nullpointerexception bundle






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Nov 16 '18 at 3:50







      Abhishek

















      asked Nov 14 '18 at 14:32









      AbhishekAbhishek

      12




      12






















          2 Answers
          2






          active

          oldest

          votes


















          0














          String StrArr = new String[selectedItems.size()];

          for (int i = 0; i < selectedItems.size(); i++)
          StrArr[i] = selectedItems.get(i);



          I think, your bug is in this moment. Something wrong with selected items. Log all values of that items, before putting it to the bundle. I think your selected items are empty.






          share|improve this answer























          • I think the problem is that when I add the listview items from pending activity to allowed_to activity's listview they get added. But when I want to view the allowed_to listview from main activity, it appears to be completely empty

            – Abhishek
            Nov 15 '18 at 14:12


















          0














          Your class allowed_to extends pending (a real Activity) and maybe its context. So when you call



          Bundle bundle = getIntent().getExtras();


          you're actually trying to get the pending Activity bundle.



          So my best guess is to make allowed_to extend AppCompatActivity as pending does.






          share|improve this answer























          • Tried it..doesn't work :(

            – Abhishek
            Nov 15 '18 at 11:02










          Your Answer






          StackExchange.ifUsing("editor", function ()
          StackExchange.using("externalEditor", function ()
          StackExchange.using("snippets", function ()
          StackExchange.snippets.init();
          );
          );
          , "code-snippets");

          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "1"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader:
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          ,
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );













          draft saved

          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53302593%2fjava-lang-string-android-os-bundle-getstringarrayjava-lang-string%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown

























          2 Answers
          2






          active

          oldest

          votes








          2 Answers
          2






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          0














          String StrArr = new String[selectedItems.size()];

          for (int i = 0; i < selectedItems.size(); i++)
          StrArr[i] = selectedItems.get(i);



          I think, your bug is in this moment. Something wrong with selected items. Log all values of that items, before putting it to the bundle. I think your selected items are empty.






          share|improve this answer























          • I think the problem is that when I add the listview items from pending activity to allowed_to activity's listview they get added. But when I want to view the allowed_to listview from main activity, it appears to be completely empty

            – Abhishek
            Nov 15 '18 at 14:12















          0














          String StrArr = new String[selectedItems.size()];

          for (int i = 0; i < selectedItems.size(); i++)
          StrArr[i] = selectedItems.get(i);



          I think, your bug is in this moment. Something wrong with selected items. Log all values of that items, before putting it to the bundle. I think your selected items are empty.






          share|improve this answer























          • I think the problem is that when I add the listview items from pending activity to allowed_to activity's listview they get added. But when I want to view the allowed_to listview from main activity, it appears to be completely empty

            – Abhishek
            Nov 15 '18 at 14:12













          0












          0








          0







          String StrArr = new String[selectedItems.size()];

          for (int i = 0; i < selectedItems.size(); i++)
          StrArr[i] = selectedItems.get(i);



          I think, your bug is in this moment. Something wrong with selected items. Log all values of that items, before putting it to the bundle. I think your selected items are empty.






          share|improve this answer













          String StrArr = new String[selectedItems.size()];

          for (int i = 0; i < selectedItems.size(); i++)
          StrArr[i] = selectedItems.get(i);



          I think, your bug is in this moment. Something wrong with selected items. Log all values of that items, before putting it to the bundle. I think your selected items are empty.







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Nov 14 '18 at 16:44









          GensaGamesGensaGames

          1,525726




          1,525726












          • I think the problem is that when I add the listview items from pending activity to allowed_to activity's listview they get added. But when I want to view the allowed_to listview from main activity, it appears to be completely empty

            – Abhishek
            Nov 15 '18 at 14:12

















          • I think the problem is that when I add the listview items from pending activity to allowed_to activity's listview they get added. But when I want to view the allowed_to listview from main activity, it appears to be completely empty

            – Abhishek
            Nov 15 '18 at 14:12
















          I think the problem is that when I add the listview items from pending activity to allowed_to activity's listview they get added. But when I want to view the allowed_to listview from main activity, it appears to be completely empty

          – Abhishek
          Nov 15 '18 at 14:12





          I think the problem is that when I add the listview items from pending activity to allowed_to activity's listview they get added. But when I want to view the allowed_to listview from main activity, it appears to be completely empty

          – Abhishek
          Nov 15 '18 at 14:12













          0














          Your class allowed_to extends pending (a real Activity) and maybe its context. So when you call



          Bundle bundle = getIntent().getExtras();


          you're actually trying to get the pending Activity bundle.



          So my best guess is to make allowed_to extend AppCompatActivity as pending does.






          share|improve this answer























          • Tried it..doesn't work :(

            – Abhishek
            Nov 15 '18 at 11:02















          0














          Your class allowed_to extends pending (a real Activity) and maybe its context. So when you call



          Bundle bundle = getIntent().getExtras();


          you're actually trying to get the pending Activity bundle.



          So my best guess is to make allowed_to extend AppCompatActivity as pending does.






          share|improve this answer























          • Tried it..doesn't work :(

            – Abhishek
            Nov 15 '18 at 11:02













          0












          0








          0







          Your class allowed_to extends pending (a real Activity) and maybe its context. So when you call



          Bundle bundle = getIntent().getExtras();


          you're actually trying to get the pending Activity bundle.



          So my best guess is to make allowed_to extend AppCompatActivity as pending does.






          share|improve this answer













          Your class allowed_to extends pending (a real Activity) and maybe its context. So when you call



          Bundle bundle = getIntent().getExtras();


          you're actually trying to get the pending Activity bundle.



          So my best guess is to make allowed_to extend AppCompatActivity as pending does.







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Nov 14 '18 at 17:34









          GiovanneGiovanne

          784




          784












          • Tried it..doesn't work :(

            – Abhishek
            Nov 15 '18 at 11:02

















          • Tried it..doesn't work :(

            – Abhishek
            Nov 15 '18 at 11:02
















          Tried it..doesn't work :(

          – Abhishek
          Nov 15 '18 at 11:02





          Tried it..doesn't work :(

          – Abhishek
          Nov 15 '18 at 11:02

















          draft saved

          draft discarded
















































          Thanks for contributing an answer to Stack Overflow!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid


          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.

          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53302593%2fjava-lang-string-android-os-bundle-getstringarrayjava-lang-string%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Top Tejano songwriter Luis Silva dead of heart attack at 64

          政党

          天津地下鉄3号線