Looking at the part:
runOnUiThread(new Runnable() {
I have the problem:
The method runOnUiThread(new Runnable(){}) is undef
If you are using Fragments
just add getActivity()
Here replace :
runOnUiThread(new Runnable() {
By
getActivity().runOnUiThread(new Runnable() {
You have to setOnClickListener
that you haven't set in your code like
Button confirm = (Button) dialog.findViewById(R.id.btn_confirm);
confirm.setOnClickListener(new OnClickListener()
{
@Override
public void onClick(View v)
{
your call to method...
}
});
Write like this-
((Activity) context).runOnUiThread(new Runnable() {
@Override
public void run() {
//Code for the UiThread
}
});
For Fragment :
getActivity().runOnUiThread(new Runnable() {
@Override
public void run() {
//Code for the UiThread
}
});
This may help you.