skip to Main Content

Android Studio – How to make broadcastreceiver work on MIUI when phone is asleep?

class AlarmReceiver : BroadcastReceiver() { override fun onReceive(context: Context, intent: Intent) { Toast.makeText(context,"Ready to wake up?", Toast.LENGTH_LONG).show() val myIntent = Intent(context,AlarmActivity::class.java) myIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK) context.startActivity(myIntent) } } Manifest: <application android:allowBackup="true" android:icon="@mipmap/ic_launcher" android:label="@string/app_name" android:roundIcon="@mipmap/ic_launcher_round" android:supportsRtl="true" android:theme="@style/Theme.QuickNap"> <activity android:name=".AlarmActivity" android:screenOrientation="portrait" android:theme="@style/Theme.NoActioBar" android:windowSoftInputMode="adjustResize"></activity> <!-- <receiver-->…

VIEW QUESTION

Android Studio – Android TextInputLayout Crashed app when I had added 'style'

I've got problem with TextInputLayout from material components for android. When I add style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox.Dense" to my TextInputLayout, app has crashed. All code .xml is like fragment. <?xml version="1.0" encoding="utf-8"?> <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" tools:context=".CreatorFragment" android:background="@color/cardview_dark_background"> <LinearLayout android:orientation="vertical" android:padding="20dp"…

VIEW QUESTION
Back To Top
Search