skip to Main Content

Android Studio – PutExtra(String!.String?) is givng error (in android Kotlin), what could be the problem?

MainActivity.kt PutExtra(String!.String?) is givng error (in android Kotlin), what could be the problem? class MainActivity : AppCompatActivity() { override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setContentView(R.layout.activity_main) } var name:EditText? = null fun createBirthdayCard(view: View) { name = findViewById(R.id.NameInput) val intent =…

VIEW QUESTION

Android Studio – Unable to start activity: java.lang.IllegalArgumentException: Targeting S+ (version 31 and above) requires that one of FLAG_IMMUTABLE or FLAG_MUTABLE

today my phone updated to android 12 and my app started to crash when I launch it. It is supposed to send a notification when launched. val intent = Intent(this, MainActivity::class.java) val pendingIntent: PendingIntent? = TaskStackBuilder.create(this).run { addNextIntentWithParentStack(intent) getPendingIntent(INTENT_REQUEST, PendingIntent.FLAG_IMMUTABLE)…

VIEW QUESTION

Android Studio – How to set Intent in setOnClickListener in ViewPager2 in Android Studio?

@Override public void onBindViewHolder(@NonNull ImageViewHolder holder, @SuppressLint("RecyclerView") int position) { holder.imageView.setImageResource(imageList.get(position)); if(position == imageList.size() - 2){ viewPager2.post(runnable); } holder.itemView.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { Toast.makeText(view.getContext(), "You clicked on : " + position, Toast.LENGTH_SHORT).show(); if(position == 0){ Toast.makeText(viewPager2.getContext(),…

VIEW QUESTION

Android Studio – How to open both WhatsApp and GB-Whatsapp using an Intent in your Android App

I want to open chooser for both whatsapp and gb-whatsapp so the user can choose any of one from them. This code is only opening whatsapp only. Intent intentWhatsapp = new Intent(Intent.ACTION_VIEW); String url = "https://chat.whatsapp.com/JPJSkaiqmDu5gLKqUPAfMM"; intentWhatsapp.setData(Uri.parse(url)); intentWhatsapp.setPackage("com.whatsapp"); startActivity(intentWhatsapp);

VIEW QUESTION

Android Studio – How to send checked items in List View to another activity with Android Studio Kotlin

I have a list of courses in my String resource file. ''' resources> <string name="app_name">SecondPart</string> <string name="done">Done</string> <string-array name="courses"> <item>Introduction To Programming</item> <item>Introduction To Programming</item> <item>Introduction To Programming</item> <item>Introduction To Programming</item> <item>Introduction To Programming</item> <item>Introduction To Programming</item> <item>Introduction To Programming</item>…

VIEW QUESTION
Back To Top
Search