Category : android-studio-3.0

class MainActivity : AppCompatActivity() { private lateinit var binding: ActivityMainBinding override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) binding = DataBindingUtil.setContentView(this, R.layout.activity_main) getCurrentCountry() } private fun getCurrentCountry(){ val api = Retrofit.Builder().baseUrl(BASE_URL).addConverterFactory(GsonConverterFactory.create()).build().create(CountryReq::class.java) GlobalScope.launch(Dispatchers.IO) { val response = api.getCountries().awaitResponse() if(response.isSuccessful){ val data = response.body()!! withContext(Dispatchers.Main){ binding.selectCountry.text = "Demo text" } } } } } I’m trying to get data ..

Read more

When I run the app in Android studio, the word ‘(my app name)keeps stopping’ comes out and the app shuts down. What is the problem? (The program moves to subactivity when the user clicks filter on main activity, and then to restaurant activity when the user clicks collingwoodimg on main activity.) activity_main.xml <?xml version="1.0" encoding="utf-8"?> ..

Read more

I get this error when starting my app the screen goes blank and the error in the terminal is this here under. TypeError: undefined is not an object (evaluating ‘_core.NavigationActions.init’) I tried to delete my node modules folder and installing it again with yarn, but still with no success I also cleared my cache. (Here ..

Read more