skip to Main Content

Android studio 'The activity must be exported or contain an intent-filter'

I wanted to show 'RealMainActivity.kt' to first main page, so I wrote below. <activity android:name=".RealMainActivity"> <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity> but there is still Error running 'app': The activity must be exported or contain an intent-filter.…

VIEW QUESTION

Android Studio – How to use sharedpref.edit() only once

I have a code where I called sharedPref.edit() and sharedPref.apply() multiple times. How to make convert it to call only once. if (success) { val data = response.getJSONObject("data") sharedPreferences.edit().putBoolean("isLoggedIn", true).apply() sharedPreferences.edit() .putString("user_id", data.getString("user_id")).apply() sharedPreferences.edit().putString("name", data.getString("name")) .apply() sharedPreferences.edit().putString("email", data.getString("email")) .apply() sharedPreferences.edit()…

VIEW QUESTION

Android Studio – Can't change editText input from string to float

package com.example.tipcalculator import androidx.appcompat.app.AppCompatActivity import android.os.Bundle import android.widget.Button import android.widget.EditText import android.widget.TextView import kotlin.text.toFloat as kotlinTextToFloat class MainActivity : AppCompatActivity() { override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setContentView(R.layout.activity_main) supportActionBar?.hide() val tenPerTip: Button = findViewById(R.id.tenPerTipButton) val fifteenPerTip: Button = findViewById(R.id.fifteenPerTipButton) val…

VIEW QUESTION
Back To Top
Search