hi advances i need your help, please. i have URI code
Intent intent = new Intent(Intent.ACTION_VIEW ,Uri.parse("http://xxx/dev/android/ATMnet-Mobile_v1.1_vc2.apk"));
i wanna change the last URI with variable like this
Intent intent = new Intent(Intent.ACTION_VIEW ,Uri.parse("http://xxx/dev/android/ATMnet-Mobile_v1.1_vc"+stringText+".apk"));
so, the version code (vc) can modified by variable which i write
and this is my full code, anyone could correct my code?
URL textUrl;
String StringBuffer;
String stringText = "";
try {
textUrl = new URL(textSource);
BufferedReader bufferReader = new BufferedReader(new InputStreamReader(textUrl.openStream()));
while ((StringBuffer = bufferReader.readLine()) != null)
{
stringText += StringBuffer;
}
bufferReader.close();
//textServer.setText(stringText);
} catch (MalformedURLException e)
{
// TODO Auto-generated catch block
e.printStackTrace();
//textServer.setText(e.toString());
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
//textServer.setText(e.toString());
}
PackageManager manager = getPackageManager();
PackageInfo info;
try {
info = manager.getPackageInfo(getPackageName(), 0);
int version = info.versionCode;
if(Integer.parseInt(stringText) != version)
{
AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(context);
alertDialogBuilder.setTitle(""+stringText+" "+version+" is Available.");
alertDialogBuilder
.setMessage("Do you want to download?")
.setCancelable(false)
.setPositiveButton("Yes",new DialogInterface.OnClickListener()
{
public void onClick(DialogInterface dialog,int id)
{
Intent intent = new Intent(Intent.ACTION_VIEW ,Uri.parse("http://xxx/dev/android/ATMnet-Mobile_v1.1_vc2.apk"));
startActivity(intent);
}
})
.setNegativeButton("No",new DialogInterface.OnClickListener()
{
public void onClick(DialogInterface dialog,int id)
{
dialog.cancel();
}
});
// create alert dialog
AlertDialog alertDialog = alertDialogBuilder.create();
// show it
alertDialog.show();
}
} catch (NameNotFoundException e)
{
e.printStackTrace();
}
i hope anyone can help me :'(
There is no problem in changes. Concatination avaliable and it works fine.
Use
Uri.parse("something" + str + ".apk")
Good luck!
Related
I am creating an Android App with Android Studio. When I press a button, I want to send a variable value to Arduino, via Bluetooth HC-05, maybe print it in the Serial Monitor. This is the code that I am using, but it doesn't work as intented.
BluetoothAdapter btAdapter = BluetoothAdapter.getDefaultAdapter();
BluetoothDevice hc05 = btAdapter.getRemoteDevice("98:D3:91:FD:3E:F0");
BluetoothSocket btSocket = null;
try {
btSocket = hc05.createRfcommSocketToServiceRecord(mUUID);
btSocket.connect();
} catch (IOException e) {
e.printStackTrace();
}
BluetoothSocket finalBtSocket = btSocket;
button12.setOnClickListener(new View.OnClickListener() {
#Override
public void onClick(View v) {
try {
OutputStream outputStream = finalBtSocket.getOutputStream();
finalBtSocket.getOutputStream().write("S".toString().getBytes());
//outputStream.write(Integer.parseInt(puk));
} catch (IOException e) {
e.printStackTrace();
}
}
});
I have the "puk" variable that I am inserting in another Activity, and passing it through to this Activity. What I want is to be able to print the value of that variable in the Serial Monitor.
If you have any information that can help it would be greatly appreciated.
Try using this code:
BluetoothSocket btSocket = null;
try {
btSocket = hc05.createRfcommSocketToServiceRecord(mUUID);
btSocket.connect();
AlertDialog.Builder builder = new AlertDialog.Builder(Status_Poarta.this);
builder.setCancelable(true);
builder.setMessage("Connection is successful");
builder.setNegativeButton("Ok", new DialogInterface.OnClickListener() {
#Override
public void onClick(DialogInterface dialog, int which) {
dialog.cancel();
}
});
builder.show();
} catch (IOException e) {
e.printStackTrace();
AlertDialog.Builder builder = new AlertDialog.Builder(Status_Poarta.this);
builder.setCancelable(true);
builder.setMessage("No connection established");
builder.setNegativeButton("Ok", new DialogInterface.OnClickListener() {
#Override
public void onClick(DialogInterface dialog, int which) {
dialog.cancel();
}
});
builder.show();
}
BluetoothSocket finalBtSocket = btSocket;
button12.setOnClickListener(new View.OnClickListener() {
#Override
public void onClick(View v) {
try {
OutputStream outputStream = finalBtSocket.getOutputStream();
outputStream.write(puk.getBytes());
} catch (IOException e) {
e.printStackTrace();
}
}
});
I want to show a notification or dialog (when app opens) if the current installed app is not the Updated Version (available in play store).
How can i do that?
add this dependency to your gradle file..
com.github.rampo.updatechecker:library:2.1.8
And try this code in your Activity..
public static String NEW_VERSION = "1.1.0";
public void checkForAppUpdate () {
try {
if (!((Activity) context).isFinishing()) {
UpdateChecker.setNotice(Notice.NOTIFICATION);
UpdateChecker.setNoticeIcon(R.drawable.your_notification_logo);
String s = "Hello User, New version of this application is now available on play store.";
if (Comparator.isVersionDownloadableNewer((Activity) context, NEW_VERSION)){
SharedPreferences pref = context.getSharedPreferences(UpdateChecker.PREFS_FILENAME, 0);
boolean b = pref.getBoolean(UpdateChecker.DONT_SHOW_AGAIN_PREF_KEY + NEW_VERSION, false);
if (!b) {
displayAlertDialogforPlayStore(context, "Update Available", s);
}
}
}
} catch (Exception e) {
e.printStackTrace();
}
}
And Function displayAlertDialogforPlayStore() is...
public void displayAlertDialogforPlayStore(final Context context, String title,
String message) {
try {
final AlertDialog.Builder alert = new AlertDialog.Builder(context);
alert.setIcon(R.drawable.your_notification_logo);
if (title != null) {
alert.setTitle(title);
}
alert.setMessage(message);
alert.setPositiveButton("Update Now", new DialogInterface.OnClickListener() {
#Override
public void onClick(DialogInterface dialog, int which) {
final String appPackageName = context.getPackageName();
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setData(Uri.parse("market://details?id=" + appPackageName));
context.startActivity(intent);
}
});
alert.setNegativeButton("Later", new DialogInterface.OnClickListener() {
#Override
public void onClick(DialogInterface dialog, int which) {
}
});
alert.show();
} catch (Exception e) {
e.printStackTrace();
}
}
This code display both notification and alertDailog for update.
You can use Firebase notifications as described here. You can choose your segment (e.g. app version) as described here.
I'm loading a text file into an EditText but the file only gets partially loaded. I've tried two different files and get the same result. One file gets cut off halfway through line 35 and the other line 37. No idea why.
<com.mobilewebtoolkit.EditTextLineNumbers
android:id="#+id/ide"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:layout_alignParentRight="true"
android:layout_alignParentTop="true"
android:ems="10"
android:gravity="left"
android:inputType="textMultiLine"
android:lineSpacingExtra="5dp"
android:textSize="15sp"
android:visibility="visible" >
code:
private void openFile(final File aFile) {
String nullChk = et.getText().toString();
if (!changed || nullChk.matches("")) {
try {
currentFile = aFile;
getExt();
et.setText(new Scanner(currentFile).useDelimiter("\\Z").next());
changed = false;
exists = true;
} catch (FileNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
} else {
AlertDialog.Builder alert = new AlertDialog.Builder(this);
alert.setTitle("Save first?");
alert.setMessage("(Will be saved in the current working directory)");
alert.setPositiveButton("Yes",
new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog,
int whichButton) {
String temptxt = et.getText().toString();
if (currentFile.exists()) {
try {
saveFile(currentFile.getPath(), temptxt);
currentFile = aFile;
getExt();
} catch (NullPointerException e) {
Log.i("NullPointer", currentFile.getName());
}
try {
et.setText(new Scanner(currentFile)
.useDelimiter("\\Z").next());
getExt();
if (extension.equals("txt")) {
Toast.makeText(MainActivity.this,
"Extension: " + extension,
Toast.LENGTH_LONG).show();
} else if (extension.equals("html")
|| extension.equals("htm")) {
Toast.makeText(MainActivity.this,
"Extension: " + extension,
Toast.LENGTH_LONG).show();
} else if (extension.equals("css")) {
Toast.makeText(MainActivity.this,
"Extension: " + extension,
Toast.LENGTH_LONG).show();
} else if (extension.equals("js")) {
Toast.makeText(MainActivity.this,
"Extension: " + extension,
Toast.LENGTH_LONG).show();
} else if (extension.equals("php")) {
Toast.makeText(MainActivity.this,
"Extension: " + extension,
Toast.LENGTH_LONG).show();
} else if (extension.equals("xml")) {
Toast.makeText(MainActivity.this,
"Extension: " + extension,
Toast.LENGTH_LONG).show();
}
changed = false;
} catch (FileNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
} else {
saveAs(null);
}
}
});
final File tempFile = aFile;
alert.setNegativeButton("No",
new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog,
int whichButton) {
try {
et.setText(new Scanner(tempFile).useDelimiter(
"\\Z").next());
changed = false;
} catch (FileNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
changed = false;
}
});
alert.setNeutralButton("Cancel",
new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog,
int whichButton) {
changed = true;
dialog.cancel();
}
});
alert.show();
}
}
You should iterate over your Scanner until hasNext() return false to make sure the whole file is read. See more information here: Beware of using java.util.Scanner with “/z”
StringBuilder sb = new StringBuilder();
Scanner scanner = new Scanner(tempFile).useDelimiter("\\Z");
while (scanner.hasNext()) {
sb.append(scanner.next());
}
et.setText(sb);
I want to open alert dialog box after successfully submitted data.
I am using following code but not work.
dialog = ProgressDialog.show(TanantDetails.this, "", "Please Wait...", true);
new Thread(new Runnable() {
public void run() {
String response;
SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(getApplicationContext());
SharedPreferences sp=getSharedPreferences("login",MODE_WORLD_READABLE);
try {
Utility utility=new Utility();
//
new_url=url+mobile_no.getText().toString();
response = utility.getResponse(utility.urlEncode(new_url));
dialog.dismiss();
if (response.equals("Success"))
{
AlertDialog alertbox = new AlertDialog.Builder(getBaseContext())
//.setIcon(R.drawable.no)
.setTitle("Submit successfully")
.setMessage("“Police will verify documents between preferred timing")
.setPositiveButton("ok", new DialogInterface.OnClickListener() {
// do something when the button is clicked
public void onClick(DialogInterface arg0, int arg1) {
TanantDetails.this.finish();
Intent i=new Intent(getApplicationContext(),MainActivity.class);
i.setFlags(Intent.FLAG_ACTIVITY_NO_HISTORY);
startActivity(i);
}
})
.show();
}
} catch (UnsupportedEncodingException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (ClientProtocolException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
// Toast.makeText(getApplicationContext(), response, Toast.LENGTH_LONG).show();
}
}).start();
}
toast show the message response success.
I am new to android
Simple Alert Dialog
AlertDialog.Builder builder = new AlertDialog.Builder(this);
builder.setMessage("Alert")
.setTitle("Warning");
AlertDialog alert =builder.create();
alert.show();
If you want to add ok, cancel buttons then add
builder.setPositiveButton("Ok", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) {
// User clicked OK button
}
});
builder.setNegativeButton("Cancel", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) {
// User clicked cancel button
}
});
Try this code:
new AlertDialog.Builder(this)
.setTitle("Your title")
.setMessage("Your message")
.setPositiveButton("Ok", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
// Your code
}
})
.setNegativeButton("Cancel", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
// do nothing
}
})
.show();
Your alert dialog needs to be displayed on the UI thread. The code you are running is on a separate thread. In most cases when you want to update a UI element while in a separate thread it is done by using runOnUiThread()
Please see the code below
if (response.equals("Success"))
{
runOnUiThread(new Runnable() {
#Override
public void run() {
AlertDialog alertbox = new AlertDialog.Builder(getBaseContext())
//.setIcon(R.drawable.no)
.setTitle("Submit successfully")
.setMessage("“Police will verify documents between preferred timing")
.setPositiveButton("ok", new DialogInterface.OnClickListener() {
// do something when the button is clicked
public void onClick(DialogInterface arg0, int arg1) {
TanantDetails.this.finish();
Intent i=new Intent(getApplicationContext(),MainActivity.class);
i.setFlags(Intent.FLAG_ACTIVITY_NO_HISTORY);
startActivity(i);
}
}).show();
}
});
}
I am having problems making my TextViews visible from another thread using the method showDisclaimer(). I have used runOnUiThread() to set the visibility of my TextViews. Basically, I want to show these views after importing the csv to the database. Can you take a look and see what I missed?
public class MainActivity extends Activity {
final static int INDEX_ACCTTYPE = 0;
final static int INDEX_ECN = 1;
final static int INDEX_TLN = 2;
final static int INDEX_SIN = 3;
final static int INDEX_MOBILE = 4;
final static int INDEX_CITY = 5;
final static int INDEX_START_DATE = 6;
final static int INDEX_START_TIME = 7;
final static int INDEX_END_DATE = 8;
final static int INDEX_END_TIME = 9;
final static int INDEX_REASON = 10;
final static int INDEX_DETAILS = 11;
DatabaseHandler db;
String str;
ProgressDialog pd;
final private String csvFile = "http://www.meralco.com.ph/pdf/pms/pms_test.csv";
final private String uploadDateFile = "http://www.meralco.com.ph/pdf/pms/UploadDate_test.txt";
#Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
TextView homeText1 = (TextView) findViewById(R.id.home_text1);
TextView homeText2 = (TextView) findViewById(R.id.home_text2);
TextView homeText3 = (TextView) findViewById(R.id.home_text3);
TextView homeText4 = (TextView) findViewById(R.id.home_text4);
homeText1.setVisibility(View.INVISIBLE);
homeText2.setVisibility(View.INVISIBLE);
homeText3.setVisibility(View.INVISIBLE);
homeText4.setVisibility(View.INVISIBLE);
//db = new DatabaseHandler(MainActivity.this);
if(dbExists()){
db = new DatabaseHandler(MainActivity.this);
Log.d("Count", "" + db.count());
if(!uploadDateEqualsDateInFile())
promptOptionalUpdate("There is a new schedule");
showDisclaimer();
Log.i("oncreate", "finished!");
return;
}
promptRequiredUpdate("Schedule not updated");
//showDisclaimer();
Log.i("oncreate", "finished!");
}
public void promptOptionalUpdate(String Message) {
AlertDialog.Builder builder = new AlertDialog.Builder(
this);
builder.setMessage(Message)
.setCancelable(false)
.setPositiveButton("Update Now",
new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) {
Log.d("SHOW ALERT -->!", "update");
dropOldSchedule();
triggerDownload();
dialog.cancel();
}
})
.setNegativeButton("Later",
new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) {
Log.d("SHOW ALERT -->!", "cancel");
dialog.cancel();
}
});
AlertDialog alert = builder.create();
alert.show();
}
public void dropOldSchedule(){
//TODO drop old schedule
}
public void triggerDownload() {
if (!checkInternet()) {
showAlert("An internet connection is required to perform an update, please check that you are connected to the internet");
return;
}
if(pd!=null && pd.isShowing()) pd.dismiss();
pd = ProgressDialog.show(this, "Downloading schedule",
"This may take a few minutes...", true, false);
Thread thread = new Thread(new Runnable() {
public void run() {
db = new DatabaseHandler(MainActivity.this);
db.beginTransaction();
try {
URL myURL = new URL(csvFile);
BufferedReader so = new BufferedReader(new InputStreamReader(myURL.openStream()));
while (true) {
String output = so.readLine();
if (output != null) {
String[] sched = output.split(",");
try {
db.addRow(sched[INDEX_SIN], sched[INDEX_CITY],
sched[INDEX_START_DATE], sched[INDEX_START_TIME],
sched[INDEX_END_DATE], sched[INDEX_END_TIME],
sched[INDEX_DETAILS], sched[INDEX_REASON]);
} catch (IndexOutOfBoundsException e) {
db.addRow(sched[INDEX_SIN], sched[INDEX_CITY],
sched[INDEX_START_DATE], sched[INDEX_START_TIME],
sched[INDEX_END_DATE], sched[INDEX_END_TIME],
"", sched[INDEX_REASON]);
e.printStackTrace();
}
}
else {
break;
}
}
so.close();
} catch (MalformedURLException e) {
e.printStackTrace();
db.endTransaction();
} catch (IOException e) {
e.printStackTrace();
db.endTransaction();
}
Log.d("Count", ""+db.count());
db.setTransactionSuccessful();
db.endTransaction();
runOnUiThread(new Runnable() {
public void run() {
while (!pd.isShowing());
getUploadDate();
writeUploadDateInTextFile();
showDisclaimer();
pd.dismiss();
}
});
}
});
thread.start();
//while(thread.isAlive());
Log.d("triggerDownload", "thread died, finished dl. showing disclaimer...");
}
public void getUploadDate() {
Log.d("getUploadDate", "getting upload date of schedule");
if(pd!=null && pd.isShowing()) pd.dismiss();
pd = ProgressDialog.show(this, "Getting upload date",
"This may take a few minutes...", true, false);
Thread thread = new Thread(new Runnable() {
public void run() {
try {
URL myURL = new URL(uploadDateFile);
BufferedReader so = new BufferedReader(new InputStreamReader(myURL.openStream()));
while (true) {
String output = so.readLine();
if (output != null) {
str = output;
}
else {
break;
}
}
so.close();
}
catch (MalformedURLException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
runOnUiThread(new Runnable() {
public void run() {
while (!pd.isShowing());
pd.dismiss();
}
});
}
});
thread.start();
while (thread.isAlive());
Log.d("getUploadDate","thread died, upload date="+str);
}
public void writeUploadDateInTextFile() {
Log.d("writeUploadDateTextFile", "writing:"+str);
try {
OutputStreamWriter out = new OutputStreamWriter(openFileOutput(
"update.txt", 0));
out.write(str);
out.close();
} catch (java.io.IOException e) {
e.printStackTrace();
}
}
public void showDisclaimer() {
Log.d("ShowDisclaimer", "showing disclaimer");
TextView homeText1x = (TextView) findViewById(R.id.home_text1);
TextView homeText2x = (TextView) findViewById(R.id.home_text2);
TextView homeText3x = (TextView) findViewById(R.id.home_text3);
TextView homeText4x = (TextView) findViewById(R.id.home_text4);
homeText3x
.setText("You may view the schedule of pre-arranged power interruptions by clicking any of these buttons : SIN, City or Date. " +
"The schedule has been updated as of " + str
+ ". Meralco is exerting all efforts to restore electric service as scheduled." +
" The schedule, however, may change without further notice. For verification, follow-ups, or " +
"latest updates, please contact our CALL CENTER through telephone nos. 16211, " +
"fax nos. 1622-8554/1622-8556 or email address callcenter.tech.assist#meralco.com.ph.");
homeText1x.setVisibility(View.VISIBLE);
homeText2x.setVisibility(View.VISIBLE);
homeText3x.setVisibility(View.VISIBLE);
homeText4x.setVisibility(View.VISIBLE);
Log.d("ShowDisclaimer", "finished showing disclaimer");
}
public void promptRequiredUpdate(String Message) {
Log.d("required update","required!");
AlertDialog.Builder builder = new AlertDialog.Builder(
this);
builder.setMessage(Message)
.setCancelable(false)
.setPositiveButton("Update Now",
new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) {
Log.d("SHOW ALERT -->!", "update");
triggerDownload();
dialog.cancel();
}
})
.setNegativeButton("Later",
new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) {
Log.d("SHOW ALERT -->!", "cancel");
dialog.cancel();
finish();
}
});
AlertDialog alert = builder.create();
alert.show();
}
public boolean uploadDateEqualsDateInFile() {
Log.d("uploadDateEqualsDateInFile","comparing schedule upload dates");
getUploadDate();
try {
String recordedDate = "";
InputStream instream = openFileInput("update.txt");
if (instream != null) { // if file the available for reading
Log.d("uploadDateEqualsDateInFile","update.txt found!");
InputStreamReader inputreader = new InputStreamReader(instream);
BufferedReader buffreader = new BufferedReader(inputreader);
String line = null;
while ((line = buffreader.readLine()) != null) {
recordedDate = line;
Log.d("uploadDateEqualsDateInFile","recorded:"+recordedDate);
}
Log.d("uploadDateEqualsDateInFile","last upload date: " + str + ", recorded:" +recordedDate);
if(str.equals(recordedDate)) return true;
return false;
}
Log.d("uploadDateEqualsDateInFile","update.txt is null!");
return false;
} catch (FileNotFoundException e) {
e.printStackTrace();
return false;
} catch (IOException e) {
e.printStackTrace();
return false;
}
}
public void showAlert(String Message) {
AlertDialog.Builder builder = new AlertDialog.Builder(getBaseContext());
builder.setMessage(Message).setCancelable(false)
.setNeutralButton("Ok", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) {
dialog.cancel();
}
});
AlertDialog alert = builder.create();
alert.show();
}
public boolean checkInternet() {
ConnectivityManager cm = (ConnectivityManager) this
.getSystemService(Context.CONNECTIVITY_SERVICE);
NetworkInfo infos[] = cm.getAllNetworkInfo();
for (NetworkInfo info : infos)
if (info.getState() == NetworkInfo.State.CONNECTED
|| info.getState() == NetworkInfo.State.CONNECTING) {
return true;
}
return false;
}
public boolean dbExists() {
File database=getApplicationContext().getDatabasePath(DatabaseHandler.DATABASE_NAME);
if (!database.exists()) {
Log.i("Database", "Not Found");
return false;
}
Log.i("Database", "Found");
return true;
}
#Override
protected void onDestroy() {
super.onDestroy();
if (db != null) {
db.close();
}
}
#Override
protected void onPause() {
super.onPause();
if (db != null) {
db.close();
}
}
}
simplymoody, do what Chirag Raval suggested by declaring private static TextView homeText1, globally and in your onCreate initialise them. However, you should always update the UI from the main thread. But showDisclaimer() is still running on the background thread, so you could run the showDisclaimer() a couple of different ways. One would be to do what you have done in getUploadDate():
runOnUiThread(new Runnable() {
public void run() {
showDisclaimer()
}
});
Or you could use a handler:
private Handler showDisclaimerHandler = new Handler(new Handler.Callback() {
#Override
public boolean handleMessage(Message msg) {
homeText3x.setText("TEXT");
homeText1x.setVisibility(View.VISIBLE);
homeText2x.setVisibility(View.VISIBLE);
homeText3x.setVisibility(View.VISIBLE);
homeText4x.setVisibility(View.VISIBLE);
Log.d("ShowDisclaimer", "finished showing disclaimer");
return false;
}
});
And everywhere in a background thread you wish to run your showDisclaimer(), instead you run:
showDisclaimerHandler.sendEmptyMessage(0);