调整Toast位置

PtzNew
Matthew 3 months ago
parent 70b795fe27
commit fd84d84157

@ -56,6 +56,7 @@ import android.telephony.TelephonyManager;
import android.text.TextUtils;
import android.text.format.DateFormat;
import android.util.Log;
import android.view.Gravity;
import android.widget.RemoteViews;
import android.widget.Toast;
@ -1238,7 +1239,9 @@ public class MicroPhotoService extends Service {
new Runnable() {
public void run() {
// Log.d(TAG, "Bluetooth Low Energy device is connected!!");
Toast.makeText(getApplicationContext(), "MP Connected!", Toast.LENGTH_SHORT).show();
Toast toast = Toast.makeText(getApplicationContext(), "MP Connected!", Toast.LENGTH_SHORT);
toast.setGravity(Gravity.TOP, 0, 0);
toast.show();
mStateService = STATE_SERVICE.CONNECTED;
startForeground(NOTIFICATION_ID_FOREGROUND_SERVICE, prepareNotification());
}

Loading…
Cancel
Save