'java.lang.String[] android.os.Bundle.getStringArray(java.lang.String)'
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
add a comment |
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
add a comment |
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
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
android listview nullpointerexception bundle
edited Nov 16 '18 at 3:50
Abhishek
asked Nov 14 '18 at 14:32
AbhishekAbhishek
12
12
add a comment |
add a comment |
2 Answers
2
active
oldest
votes
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.
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
add a comment |
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.
Tried it..doesn't work :(
– Abhishek
Nov 15 '18 at 11:02
add a comment |
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
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
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.
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
add a comment |
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.
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
add a comment |
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.
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.
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
add a comment |
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
add a comment |
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.
Tried it..doesn't work :(
– Abhishek
Nov 15 '18 at 11:02
add a comment |
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.
Tried it..doesn't work :(
– Abhishek
Nov 15 '18 at 11:02
add a comment |
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.
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.
answered Nov 14 '18 at 17:34
GiovanneGiovanne
784
784
Tried it..doesn't work :(
– Abhishek
Nov 15 '18 at 11:02
add a comment |
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
add a comment |
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.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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