skip to Main Content

Android Studio – Change activity's button state from fragment

Here I have code from both my activity and my fragment: Activity: class Activity0: AppCompatActivity() { private lateinit var binding: Activity0Binding override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) binding = Activity0Binding.inflate(layoutInflater) setContentView(binding.root) binding.popUpButton.setOnClickListener { supportFragmentManager.commit { replace(R.id.quiz_fragment_container, Activity0FragmentNull()) } binding.popUpButton.isEnabled =…

VIEW QUESTION

Android Studio – Could not identify launch activity: Default Activity not found Error while Launching activity. kotlin

New android studio version android-studio-2021.1.1.11, tried creating sample empty Android app, its showing this error. I am trying this with KOTLIN Could not identify launch activity: Default Activity not found Error while Launching activity. AndroidManifest.xml contains below: <?xml version="1.0" encoding="utf-8"?>…

VIEW QUESTION

Android Studio ImageView Change Only Width and Maintain Aspect Ratio

I've got an imageview, like this: <ImageView android:id="@+id/add_image_signup" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_below="@id/other_text" android:layout_centerHorizontal="true" android:layout_marginTop="20dp" app:srcCompat="@drawable/add_button" /> which I'm trying to scale programmatically (based on device size) with Layout Params. Something like this works great: val displayMetrics = DisplayMetrics() windowManager.defaultDisplay.getMetrics(displayMetrics) val height…

VIEW QUESTION
Back To Top
Search