What do you want to save?
Add Code snippet
New code examples
-
Other 2021-10-17 01:36:03
device rotation sensor android examples
MainActivity.java package com.authorwjf.pitchandroll; import android.hardware.Sensor; import android.hardware.SensorEvent; import android.hardware.SensorEventListener; import android.hardware.SensorManager; import android.os.Bundle; import android.widget... Add solution -
Other 2021-10-16 22:24:05
failed to post notification on channel null android
public static final int PRIMARY_FOREGROUND_NOTIF_SERVICE_ID = 1001; @Override public void onCreate() { super.onCreate(); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { String id = "_channel_01"; int importanc... Add solution -
Java 2021-10-15 23:04:03
How to create a popup window (PopupWindow) in Android
public class MainActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); } public void onButtonShowPo... Add solution -
Java 2021-10-11 01:58:06
how to make phone vibrate android studio
// Vibrate for 150 milliseconds private void shakeItBaby() { if (Build.VERSION.SDK_INT >= 26) { ((Vibrator) getSystemService(VIBRATOR_SERVICE)).vibrate(VibrationEffect.createOneShot(150, VibrationEffect.DEFAULT_AMPLITUDE)); } else { ... Add solution -
Java 2021-10-09 01:40:06
vibration android studio
import android.os.Vibrator; ... // Pause for 500ms, vibrate for 500ms, then start again private static final long[] VIBRATE_PATTERN = { 500, 500 }; mVibrator = (Vibrator) getSystemService(Context.VIBRATOR_SERVICE); if (Build.VERSION.SDK_INT >= Build.... Add solution
Best helpers
+10
+5
+5
+5
+5
+5
+5
+5
+5
+5
+5
+5