How to allow a non-activity to display dialog on activity?
This question is very similar to questions that have been asked in the past but please bear with me as it is still a unique question. Basically, I have a class that gets application permissions, and if the user does not have internet running, then when the auto login screen comes, it is stuck in loading. So what I want to do is show a dialog message, and the user will click ok to close the app. For dialogs, I need the context, and I must run on the main thread. I have posted an image of the code because I want to show you that runOnUIThread
is red. Here is the error I get form Android Studio
Cannot resolve method runOnUIThread.
Here is what I had
Problem: For some reason, runOnUIThread
is not usable. Does anyone have a counter proposal, or a reason as to why I am having this problem?
Here is the code:
public void alert() {
new Thread()
{
public void run()
{
application.runOnUiThread(new Runnable() // application is the context of my current activity.
{
public void run() //I display my alert Dialog here.
{
AlertDialog build= new AlertDialog.Builder(application.getApplicationContext())
.setTitle("Error")
.setMessage("Sorry there seems to be a problem with the service. Please check to make sure you have a stable internet connection. ")
.setPositiveButton("Ok, I understand.", (dialog, which) -> System.exit(0))
.show();
build.setCancelable(false);
Button positive= build.getButton(DialogInterface.BUTTON_POSITIVE);
positive.setTextColor(application.getResources().getColor(R.color.buttonPrimaryColor));
positive.setTypeface(Typeface.defaultFromStyle(Typeface.BOLD));
}
});
}
}.start();
Here is how I have made it work with a Toast in the past.
public void shortToast(String msg) {
Observable.just(msg)
.observeOn(AndroidSchedulers.mainThread())
.subscribe(message -> {
Toast.makeText(application, message, Toast.LENGTH_SHORT).show();
});
}
// In the main method
shortToast("Sorry an error occured");
java android alert ui-thread
|
show 5 more comments
This question is very similar to questions that have been asked in the past but please bear with me as it is still a unique question. Basically, I have a class that gets application permissions, and if the user does not have internet running, then when the auto login screen comes, it is stuck in loading. So what I want to do is show a dialog message, and the user will click ok to close the app. For dialogs, I need the context, and I must run on the main thread. I have posted an image of the code because I want to show you that runOnUIThread
is red. Here is the error I get form Android Studio
Cannot resolve method runOnUIThread.
Here is what I had
Problem: For some reason, runOnUIThread
is not usable. Does anyone have a counter proposal, or a reason as to why I am having this problem?
Here is the code:
public void alert() {
new Thread()
{
public void run()
{
application.runOnUiThread(new Runnable() // application is the context of my current activity.
{
public void run() //I display my alert Dialog here.
{
AlertDialog build= new AlertDialog.Builder(application.getApplicationContext())
.setTitle("Error")
.setMessage("Sorry there seems to be a problem with the service. Please check to make sure you have a stable internet connection. ")
.setPositiveButton("Ok, I understand.", (dialog, which) -> System.exit(0))
.show();
build.setCancelable(false);
Button positive= build.getButton(DialogInterface.BUTTON_POSITIVE);
positive.setTextColor(application.getResources().getColor(R.color.buttonPrimaryColor));
positive.setTypeface(Typeface.defaultFromStyle(Typeface.BOLD));
}
});
}
}.start();
Here is how I have made it work with a Toast in the past.
public void shortToast(String msg) {
Observable.just(msg)
.observeOn(AndroidSchedulers.mainThread())
.subscribe(message -> {
Toast.makeText(application, message, Toast.LENGTH_SHORT).show();
});
}
// In the main method
shortToast("Sorry an error occured");
java android alert ui-thread
2
Please paste your code here directly rather than posting a screenshot. Also explain what "runOnUIThread is not usable" means. What happens when you try to do so?
– Code-Apprentice
Mar 2 '18 at 17:07
2
Do not add image of code . Add code in code format .
– ADM
Mar 2 '18 at 17:07
2
idownvotedbecau.se/imageofcode
– YvesLeBorg
Mar 2 '18 at 17:10
@YvesLeBorg I put an image to show you that runOnUIThread is in red. If I simply showed my code, you would not be able to see that.
– Naman Jain
Mar 2 '18 at 17:13
@Code-Apprentice. runOnUIThread is red. That is what I mean by unusable.
– Naman Jain
Mar 2 '18 at 17:14
|
show 5 more comments
This question is very similar to questions that have been asked in the past but please bear with me as it is still a unique question. Basically, I have a class that gets application permissions, and if the user does not have internet running, then when the auto login screen comes, it is stuck in loading. So what I want to do is show a dialog message, and the user will click ok to close the app. For dialogs, I need the context, and I must run on the main thread. I have posted an image of the code because I want to show you that runOnUIThread
is red. Here is the error I get form Android Studio
Cannot resolve method runOnUIThread.
Here is what I had
Problem: For some reason, runOnUIThread
is not usable. Does anyone have a counter proposal, or a reason as to why I am having this problem?
Here is the code:
public void alert() {
new Thread()
{
public void run()
{
application.runOnUiThread(new Runnable() // application is the context of my current activity.
{
public void run() //I display my alert Dialog here.
{
AlertDialog build= new AlertDialog.Builder(application.getApplicationContext())
.setTitle("Error")
.setMessage("Sorry there seems to be a problem with the service. Please check to make sure you have a stable internet connection. ")
.setPositiveButton("Ok, I understand.", (dialog, which) -> System.exit(0))
.show();
build.setCancelable(false);
Button positive= build.getButton(DialogInterface.BUTTON_POSITIVE);
positive.setTextColor(application.getResources().getColor(R.color.buttonPrimaryColor));
positive.setTypeface(Typeface.defaultFromStyle(Typeface.BOLD));
}
});
}
}.start();
Here is how I have made it work with a Toast in the past.
public void shortToast(String msg) {
Observable.just(msg)
.observeOn(AndroidSchedulers.mainThread())
.subscribe(message -> {
Toast.makeText(application, message, Toast.LENGTH_SHORT).show();
});
}
// In the main method
shortToast("Sorry an error occured");
java android alert ui-thread
This question is very similar to questions that have been asked in the past but please bear with me as it is still a unique question. Basically, I have a class that gets application permissions, and if the user does not have internet running, then when the auto login screen comes, it is stuck in loading. So what I want to do is show a dialog message, and the user will click ok to close the app. For dialogs, I need the context, and I must run on the main thread. I have posted an image of the code because I want to show you that runOnUIThread
is red. Here is the error I get form Android Studio
Cannot resolve method runOnUIThread.
Here is what I had
Problem: For some reason, runOnUIThread
is not usable. Does anyone have a counter proposal, or a reason as to why I am having this problem?
Here is the code:
public void alert() {
new Thread()
{
public void run()
{
application.runOnUiThread(new Runnable() // application is the context of my current activity.
{
public void run() //I display my alert Dialog here.
{
AlertDialog build= new AlertDialog.Builder(application.getApplicationContext())
.setTitle("Error")
.setMessage("Sorry there seems to be a problem with the service. Please check to make sure you have a stable internet connection. ")
.setPositiveButton("Ok, I understand.", (dialog, which) -> System.exit(0))
.show();
build.setCancelable(false);
Button positive= build.getButton(DialogInterface.BUTTON_POSITIVE);
positive.setTextColor(application.getResources().getColor(R.color.buttonPrimaryColor));
positive.setTypeface(Typeface.defaultFromStyle(Typeface.BOLD));
}
});
}
}.start();
Here is how I have made it work with a Toast in the past.
public void shortToast(String msg) {
Observable.just(msg)
.observeOn(AndroidSchedulers.mainThread())
.subscribe(message -> {
Toast.makeText(application, message, Toast.LENGTH_SHORT).show();
});
}
// In the main method
shortToast("Sorry an error occured");
java android alert ui-thread
java android alert ui-thread
edited Nov 25 '18 at 11:38
Thomas Fritsch
5,241122133
5,241122133
asked Mar 2 '18 at 17:05
Naman JainNaman Jain
379
379
2
Please paste your code here directly rather than posting a screenshot. Also explain what "runOnUIThread is not usable" means. What happens when you try to do so?
– Code-Apprentice
Mar 2 '18 at 17:07
2
Do not add image of code . Add code in code format .
– ADM
Mar 2 '18 at 17:07
2
idownvotedbecau.se/imageofcode
– YvesLeBorg
Mar 2 '18 at 17:10
@YvesLeBorg I put an image to show you that runOnUIThread is in red. If I simply showed my code, you would not be able to see that.
– Naman Jain
Mar 2 '18 at 17:13
@Code-Apprentice. runOnUIThread is red. That is what I mean by unusable.
– Naman Jain
Mar 2 '18 at 17:14
|
show 5 more comments
2
Please paste your code here directly rather than posting a screenshot. Also explain what "runOnUIThread is not usable" means. What happens when you try to do so?
– Code-Apprentice
Mar 2 '18 at 17:07
2
Do not add image of code . Add code in code format .
– ADM
Mar 2 '18 at 17:07
2
idownvotedbecau.se/imageofcode
– YvesLeBorg
Mar 2 '18 at 17:10
@YvesLeBorg I put an image to show you that runOnUIThread is in red. If I simply showed my code, you would not be able to see that.
– Naman Jain
Mar 2 '18 at 17:13
@Code-Apprentice. runOnUIThread is red. That is what I mean by unusable.
– Naman Jain
Mar 2 '18 at 17:14
2
2
Please paste your code here directly rather than posting a screenshot. Also explain what "runOnUIThread is not usable" means. What happens when you try to do so?
– Code-Apprentice
Mar 2 '18 at 17:07
Please paste your code here directly rather than posting a screenshot. Also explain what "runOnUIThread is not usable" means. What happens when you try to do so?
– Code-Apprentice
Mar 2 '18 at 17:07
2
2
Do not add image of code . Add code in code format .
– ADM
Mar 2 '18 at 17:07
Do not add image of code . Add code in code format .
– ADM
Mar 2 '18 at 17:07
2
2
idownvotedbecau.se/imageofcode
– YvesLeBorg
Mar 2 '18 at 17:10
idownvotedbecau.se/imageofcode
– YvesLeBorg
Mar 2 '18 at 17:10
@YvesLeBorg I put an image to show you that runOnUIThread is in red. If I simply showed my code, you would not be able to see that.
– Naman Jain
Mar 2 '18 at 17:13
@YvesLeBorg I put an image to show you that runOnUIThread is in red. If I simply showed my code, you would not be able to see that.
– Naman Jain
Mar 2 '18 at 17:13
@Code-Apprentice. runOnUIThread is red. That is what I mean by unusable.
– Naman Jain
Mar 2 '18 at 17:14
@Code-Apprentice. runOnUIThread is red. That is what I mean by unusable.
– Naman Jain
Mar 2 '18 at 17:14
|
show 5 more comments
2 Answers
2
active
oldest
votes
For some reason, runOnUIThread is not usable
The method that you are trying to invoke is runOnUiThread()
. That is a method on Activity
. Whatever application
is, it is not an Activity
.
Does anyone have a counter proposal
Move this code into an Activity
. Generally, pop-ups (dialogs, snackbars, etc.) should be displayed by an Activity
. And only an Activity
can show a Dialog
, such as an AlertDialog
.
Very nice explanation. So I have changed it to RegisterInfoActivity.runOnUiThread(new Runnable().
– Naman Jain
Mar 2 '18 at 17:19
But for some reason runOnUiThread is now showing me a different error. Is there any way for me to use alertDialog outside the activity? I have been successful with toast messages.
– Naman Jain
Mar 2 '18 at 17:22
@NamanJain What error? I suspect something like "cannot call method in a static context." Is that right?
– Code-Apprentice
Mar 2 '18 at 17:23
yes that is the message.
– Naman Jain
Mar 2 '18 at 17:23
@NamanJain:RegisterInfoActivity
is a Java class.runOnUiThread()
is not astatic
method; you do not call it on the class. "Is there any way for me to use alertDialog outside the activity?" -- not realistically. I would expect your code to crash when you try creating the dialog;Dialog
can only be created by anActivity
, not an arbitraryContext
.
– CommonsWare
Mar 2 '18 at 17:26
|
show 7 more comments
Try to use an activity to run on UI, not application
Alex RED, I need the run on UI to be in a separate class. I cannot put it into an activity.
– Naman Jain
Mar 2 '18 at 17:17
Put an instance of activity to the constructor of your class or into your alert() function
– Alex RED
Mar 2 '18 at 17:22
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%2f49073967%2fhow-to-allow-a-non-activity-to-display-dialog-on-activity%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
For some reason, runOnUIThread is not usable
The method that you are trying to invoke is runOnUiThread()
. That is a method on Activity
. Whatever application
is, it is not an Activity
.
Does anyone have a counter proposal
Move this code into an Activity
. Generally, pop-ups (dialogs, snackbars, etc.) should be displayed by an Activity
. And only an Activity
can show a Dialog
, such as an AlertDialog
.
Very nice explanation. So I have changed it to RegisterInfoActivity.runOnUiThread(new Runnable().
– Naman Jain
Mar 2 '18 at 17:19
But for some reason runOnUiThread is now showing me a different error. Is there any way for me to use alertDialog outside the activity? I have been successful with toast messages.
– Naman Jain
Mar 2 '18 at 17:22
@NamanJain What error? I suspect something like "cannot call method in a static context." Is that right?
– Code-Apprentice
Mar 2 '18 at 17:23
yes that is the message.
– Naman Jain
Mar 2 '18 at 17:23
@NamanJain:RegisterInfoActivity
is a Java class.runOnUiThread()
is not astatic
method; you do not call it on the class. "Is there any way for me to use alertDialog outside the activity?" -- not realistically. I would expect your code to crash when you try creating the dialog;Dialog
can only be created by anActivity
, not an arbitraryContext
.
– CommonsWare
Mar 2 '18 at 17:26
|
show 7 more comments
For some reason, runOnUIThread is not usable
The method that you are trying to invoke is runOnUiThread()
. That is a method on Activity
. Whatever application
is, it is not an Activity
.
Does anyone have a counter proposal
Move this code into an Activity
. Generally, pop-ups (dialogs, snackbars, etc.) should be displayed by an Activity
. And only an Activity
can show a Dialog
, such as an AlertDialog
.
Very nice explanation. So I have changed it to RegisterInfoActivity.runOnUiThread(new Runnable().
– Naman Jain
Mar 2 '18 at 17:19
But for some reason runOnUiThread is now showing me a different error. Is there any way for me to use alertDialog outside the activity? I have been successful with toast messages.
– Naman Jain
Mar 2 '18 at 17:22
@NamanJain What error? I suspect something like "cannot call method in a static context." Is that right?
– Code-Apprentice
Mar 2 '18 at 17:23
yes that is the message.
– Naman Jain
Mar 2 '18 at 17:23
@NamanJain:RegisterInfoActivity
is a Java class.runOnUiThread()
is not astatic
method; you do not call it on the class. "Is there any way for me to use alertDialog outside the activity?" -- not realistically. I would expect your code to crash when you try creating the dialog;Dialog
can only be created by anActivity
, not an arbitraryContext
.
– CommonsWare
Mar 2 '18 at 17:26
|
show 7 more comments
For some reason, runOnUIThread is not usable
The method that you are trying to invoke is runOnUiThread()
. That is a method on Activity
. Whatever application
is, it is not an Activity
.
Does anyone have a counter proposal
Move this code into an Activity
. Generally, pop-ups (dialogs, snackbars, etc.) should be displayed by an Activity
. And only an Activity
can show a Dialog
, such as an AlertDialog
.
For some reason, runOnUIThread is not usable
The method that you are trying to invoke is runOnUiThread()
. That is a method on Activity
. Whatever application
is, it is not an Activity
.
Does anyone have a counter proposal
Move this code into an Activity
. Generally, pop-ups (dialogs, snackbars, etc.) should be displayed by an Activity
. And only an Activity
can show a Dialog
, such as an AlertDialog
.
answered Mar 2 '18 at 17:17
CommonsWareCommonsWare
769k13818751926
769k13818751926
Very nice explanation. So I have changed it to RegisterInfoActivity.runOnUiThread(new Runnable().
– Naman Jain
Mar 2 '18 at 17:19
But for some reason runOnUiThread is now showing me a different error. Is there any way for me to use alertDialog outside the activity? I have been successful with toast messages.
– Naman Jain
Mar 2 '18 at 17:22
@NamanJain What error? I suspect something like "cannot call method in a static context." Is that right?
– Code-Apprentice
Mar 2 '18 at 17:23
yes that is the message.
– Naman Jain
Mar 2 '18 at 17:23
@NamanJain:RegisterInfoActivity
is a Java class.runOnUiThread()
is not astatic
method; you do not call it on the class. "Is there any way for me to use alertDialog outside the activity?" -- not realistically. I would expect your code to crash when you try creating the dialog;Dialog
can only be created by anActivity
, not an arbitraryContext
.
– CommonsWare
Mar 2 '18 at 17:26
|
show 7 more comments
Very nice explanation. So I have changed it to RegisterInfoActivity.runOnUiThread(new Runnable().
– Naman Jain
Mar 2 '18 at 17:19
But for some reason runOnUiThread is now showing me a different error. Is there any way for me to use alertDialog outside the activity? I have been successful with toast messages.
– Naman Jain
Mar 2 '18 at 17:22
@NamanJain What error? I suspect something like "cannot call method in a static context." Is that right?
– Code-Apprentice
Mar 2 '18 at 17:23
yes that is the message.
– Naman Jain
Mar 2 '18 at 17:23
@NamanJain:RegisterInfoActivity
is a Java class.runOnUiThread()
is not astatic
method; you do not call it on the class. "Is there any way for me to use alertDialog outside the activity?" -- not realistically. I would expect your code to crash when you try creating the dialog;Dialog
can only be created by anActivity
, not an arbitraryContext
.
– CommonsWare
Mar 2 '18 at 17:26
Very nice explanation. So I have changed it to RegisterInfoActivity.runOnUiThread(new Runnable().
– Naman Jain
Mar 2 '18 at 17:19
Very nice explanation. So I have changed it to RegisterInfoActivity.runOnUiThread(new Runnable().
– Naman Jain
Mar 2 '18 at 17:19
But for some reason runOnUiThread is now showing me a different error. Is there any way for me to use alertDialog outside the activity? I have been successful with toast messages.
– Naman Jain
Mar 2 '18 at 17:22
But for some reason runOnUiThread is now showing me a different error. Is there any way for me to use alertDialog outside the activity? I have been successful with toast messages.
– Naman Jain
Mar 2 '18 at 17:22
@NamanJain What error? I suspect something like "cannot call method in a static context." Is that right?
– Code-Apprentice
Mar 2 '18 at 17:23
@NamanJain What error? I suspect something like "cannot call method in a static context." Is that right?
– Code-Apprentice
Mar 2 '18 at 17:23
yes that is the message.
– Naman Jain
Mar 2 '18 at 17:23
yes that is the message.
– Naman Jain
Mar 2 '18 at 17:23
@NamanJain:
RegisterInfoActivity
is a Java class. runOnUiThread()
is not a static
method; you do not call it on the class. "Is there any way for me to use alertDialog outside the activity?" -- not realistically. I would expect your code to crash when you try creating the dialog; Dialog
can only be created by an Activity
, not an arbitrary Context
.– CommonsWare
Mar 2 '18 at 17:26
@NamanJain:
RegisterInfoActivity
is a Java class. runOnUiThread()
is not a static
method; you do not call it on the class. "Is there any way for me to use alertDialog outside the activity?" -- not realistically. I would expect your code to crash when you try creating the dialog; Dialog
can only be created by an Activity
, not an arbitrary Context
.– CommonsWare
Mar 2 '18 at 17:26
|
show 7 more comments
Try to use an activity to run on UI, not application
Alex RED, I need the run on UI to be in a separate class. I cannot put it into an activity.
– Naman Jain
Mar 2 '18 at 17:17
Put an instance of activity to the constructor of your class or into your alert() function
– Alex RED
Mar 2 '18 at 17:22
add a comment |
Try to use an activity to run on UI, not application
Alex RED, I need the run on UI to be in a separate class. I cannot put it into an activity.
– Naman Jain
Mar 2 '18 at 17:17
Put an instance of activity to the constructor of your class or into your alert() function
– Alex RED
Mar 2 '18 at 17:22
add a comment |
Try to use an activity to run on UI, not application
Try to use an activity to run on UI, not application
answered Mar 2 '18 at 17:09
Alex REDAlex RED
109111
109111
Alex RED, I need the run on UI to be in a separate class. I cannot put it into an activity.
– Naman Jain
Mar 2 '18 at 17:17
Put an instance of activity to the constructor of your class or into your alert() function
– Alex RED
Mar 2 '18 at 17:22
add a comment |
Alex RED, I need the run on UI to be in a separate class. I cannot put it into an activity.
– Naman Jain
Mar 2 '18 at 17:17
Put an instance of activity to the constructor of your class or into your alert() function
– Alex RED
Mar 2 '18 at 17:22
Alex RED, I need the run on UI to be in a separate class. I cannot put it into an activity.
– Naman Jain
Mar 2 '18 at 17:17
Alex RED, I need the run on UI to be in a separate class. I cannot put it into an activity.
– Naman Jain
Mar 2 '18 at 17:17
Put an instance of activity to the constructor of your class or into your alert() function
– Alex RED
Mar 2 '18 at 17:22
Put an instance of activity to the constructor of your class or into your alert() function
– Alex RED
Mar 2 '18 at 17:22
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%2f49073967%2fhow-to-allow-a-non-activity-to-display-dialog-on-activity%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
2
Please paste your code here directly rather than posting a screenshot. Also explain what "runOnUIThread is not usable" means. What happens when you try to do so?
– Code-Apprentice
Mar 2 '18 at 17:07
2
Do not add image of code . Add code in code format .
– ADM
Mar 2 '18 at 17:07
2
idownvotedbecau.se/imageofcode
– YvesLeBorg
Mar 2 '18 at 17:10
@YvesLeBorg I put an image to show you that runOnUIThread is in red. If I simply showed my code, you would not be able to see that.
– Naman Jain
Mar 2 '18 at 17:13
@Code-Apprentice. runOnUIThread is red. That is what I mean by unusable.
– Naman Jain
Mar 2 '18 at 17:14