Main Thread Question
- By rick smith
- Android Development
- 0 Replies
Quick question wanted to verify this handler would be running in the main thread and not a background thread.
Trying to keep the send() function in the background
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
requestWindowFeature(Window.FEATURE_NO_TITLE);
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN);
setContentView(R.layout.fu);
map = false;
// Send Telm and Update HP Dist
Handler handlert = new Handler();
handlert.postDelayed(new Runnable() {
@override
public void run() {
if (gpsrunning == 1 && !isNaN(gpsla) && !isNaN(gpslo)) {
send();
}
handlert.postDelayed(this, 1000);
}
}, 1000);
Trying to keep the send() function in the background
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
requestWindowFeature(Window.FEATURE_NO_TITLE);
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN);
setContentView(R.layout.fu);
map = false;
// Send Telm and Update HP Dist
Handler handlert = new Handler();
handlert.postDelayed(new Runnable() {
@override
public void run() {
if (gpsrunning == 1 && !isNaN(gpsla) && !isNaN(gpslo)) {
send();
}
handlert.postDelayed(this, 1000);
}
}, 1000);

The Xgody in the video was bought from Wish. Whereas the mainstream brands like Samsung, Huawei, Xiaomi, Sony, Apple, etc, are sold in reputable brick'n'mortar stores, or online directly from the manufacturer.