How to pass a string from Mainactivity.class to ContentProvider.class in Android
up vote
0
down vote
favorite
MainActivity.class
public static String data="Some text here";
ContentProvider.class
private synchronized void readContentFile(@NonNull Context context)
{
//I Need to get the String data here..
}
not able to use getIntent(); inside this class
javascript java android json
|
show 4 more comments
up vote
0
down vote
favorite
MainActivity.class
public static String data="Some text here";
ContentProvider.class
private synchronized void readContentFile(@NonNull Context context)
{
//I Need to get the String data here..
}
not able to use getIntent(); inside this class
javascript java android json
String d = MainActivity.data;
– Ty Kroll
Nov 11 at 7:08
what do you want to achieve actually? whats your goal?
– pskink
Nov 11 at 7:49
it is returning as null
– Hariharan Murugan
Nov 11 at 11:20
@pskink i will have card view in main activity based on the selection of my card some text will be stored to String data then i will have to call this to content provider class but content provider class always returns null
– Hariharan Murugan
Nov 11 at 11:21
what Uri are you using? What do you need that content provider for?
– pskink
Nov 11 at 11:28
|
show 4 more comments
up vote
0
down vote
favorite
up vote
0
down vote
favorite
MainActivity.class
public static String data="Some text here";
ContentProvider.class
private synchronized void readContentFile(@NonNull Context context)
{
//I Need to get the String data here..
}
not able to use getIntent(); inside this class
javascript java android json
MainActivity.class
public static String data="Some text here";
ContentProvider.class
private synchronized void readContentFile(@NonNull Context context)
{
//I Need to get the String data here..
}
not able to use getIntent(); inside this class
javascript java android json
javascript java android json
edited Nov 11 at 7:14
Sanchit Kumar
31117
31117
asked Nov 11 at 7:01
Hariharan Murugan
1
1
String d = MainActivity.data;
– Ty Kroll
Nov 11 at 7:08
what do you want to achieve actually? whats your goal?
– pskink
Nov 11 at 7:49
it is returning as null
– Hariharan Murugan
Nov 11 at 11:20
@pskink i will have card view in main activity based on the selection of my card some text will be stored to String data then i will have to call this to content provider class but content provider class always returns null
– Hariharan Murugan
Nov 11 at 11:21
what Uri are you using? What do you need that content provider for?
– pskink
Nov 11 at 11:28
|
show 4 more comments
String d = MainActivity.data;
– Ty Kroll
Nov 11 at 7:08
what do you want to achieve actually? whats your goal?
– pskink
Nov 11 at 7:49
it is returning as null
– Hariharan Murugan
Nov 11 at 11:20
@pskink i will have card view in main activity based on the selection of my card some text will be stored to String data then i will have to call this to content provider class but content provider class always returns null
– Hariharan Murugan
Nov 11 at 11:21
what Uri are you using? What do you need that content provider for?
– pskink
Nov 11 at 11:28
String d = MainActivity.data;
– Ty Kroll
Nov 11 at 7:08
String d = MainActivity.data;
– Ty Kroll
Nov 11 at 7:08
what do you want to achieve actually? whats your goal?
– pskink
Nov 11 at 7:49
what do you want to achieve actually? whats your goal?
– pskink
Nov 11 at 7:49
it is returning as null
– Hariharan Murugan
Nov 11 at 11:20
it is returning as null
– Hariharan Murugan
Nov 11 at 11:20
@pskink i will have card view in main activity based on the selection of my card some text will be stored to String data then i will have to call this to content provider class but content provider class always returns null
– Hariharan Murugan
Nov 11 at 11:21
@pskink i will have card view in main activity based on the selection of my card some text will be stored to String data then i will have to call this to content provider class but content provider class always returns null
– Hariharan Murugan
Nov 11 at 11:21
what Uri are you using? What do you need that content provider for?
– pskink
Nov 11 at 11:28
what Uri are you using? What do you need that content provider for?
– pskink
Nov 11 at 11:28
|
show 4 more comments
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
draft saved
draft discarded
draft saved
draft discarded
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%2f53246544%2fhow-to-pass-a-string-from-mainactivity-class-to-contentprovider-class-in-android%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
String d = MainActivity.data;
– Ty Kroll
Nov 11 at 7:08
what do you want to achieve actually? whats your goal?
– pskink
Nov 11 at 7:49
it is returning as null
– Hariharan Murugan
Nov 11 at 11:20
@pskink i will have card view in main activity based on the selection of my card some text will be stored to String data then i will have to call this to content provider class but content provider class always returns null
– Hariharan Murugan
Nov 11 at 11:21
what Uri are you using? What do you need that content provider for?
– pskink
Nov 11 at 11:28