Skip to content

Instantly share code, notes, and snippets.

@bowserf
Created February 5, 2024 02:18
Show Gist options
  • Save bowserf/91b835fe0147453355cd34120a871c72 to your computer and use it in GitHub Desktop.
Save bowserf/91b835fe0147453355cd34120a871c72 to your computer and use it in GitHub Desktop.
import android.app.PendingIntent
import android.content.Intent
import androidx.core.app.PendingIntentCompat
import com.mwm.labs.poc.audiochat.main_activity.MainActivity
private fun createPendingIntent(): PendingIntent? {
val intent = createIntent()
return PendingIntentCompat.getActivity(
/* context = */ context,
/* requestCode = */ 42,
/* intent = */ intent,
/* flags = */ PendingIntent.FLAG_ONE_SHOT,
/* isMutable = */ false
)
}
fun createIntent(): Intent {
return Intent(context, MainActivity::class.java)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment