android - Ignoring header X-Firebase-Locale because its value was null - android

I followed the steps from the documentation on setting up the email password authentication and it worked fine for a while now. I don't know why but yesterday it just stopped working and keeps giving me the error : W/System: Ignoring header X-Firebase-Locale because its value was null.
The app won't allow me to log in or sign-up anymore.
But the problem only occurs when I test my app while connected via WiFi and it works as expected when I am connected to mobile data (LTE).
I tried connecting to a VPN, in hopes that the problem is with my service provider, but the problem remained.
I've also tried testing the app on a different device, the error is still there.
I've tried following the steps provided by these answers:
https://stackoverflow.com/a/65106158/16296874
https://stackoverflow.com/a/66993601/16296874
https://stackoverflow.com/a/64657110
but nothing seems to be working.
I've seen lots of people encountered this problem and being solved in different ways. And trying those did not seem to have an effect. So I'm not sure anymore.
package com.sunnyside.kookoo.verification.ui.fragments
import android.content.Intent
import android.os.Bundle
import android.text.TextUtils
import android.util.Log
import androidx.fragment.app.Fragment
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.Toast
import androidx.navigation.fragment.findNavController
import com.google.firebase.auth.FirebaseAuth
import com.google.firebase.auth.ktx.auth
import com.google.firebase.ktx.Firebase
import com.sunnyside.kookoo.R
import com.sunnyside.kookoo.databinding.FragmentLoginBinding
import com.sunnyside.kookoo.databinding.FragmentProfileBinding
import com.sunnyside.kookoo.student.ui.StudentActivity
import com.sunnyside.kookoo.testKolanglods.ui.PangTestingLangLodsActivity
class LoginFragment : Fragment() {
private lateinit var auth: FirebaseAuth
private var _binding: FragmentLoginBinding? = null
private val binding get() = _binding!!
override fun onCreateView(
inflater: LayoutInflater, container: ViewGroup?,
savedInstanceState: Bundle?
): View? {
// Inflate the layout for this fragment
_binding = FragmentLoginBinding.inflate(inflater, container, false)
val view = binding.root
auth = Firebase.auth
binding.textLoginRegister.setOnClickListener {
findNavController().navigate(R.id.action_loginFragment_to_signupFragment)
}
binding.loginbtnBack.setOnClickListener {
findNavController().navigate(R.id.action_loginFragment_to_welcomeFragment)
}
binding.resetPasswordTxt.setOnClickListener {
findNavController().navigate(R.id.action_loginFragment_to_resetFragment)
}
binding.loginBtn.setOnClickListener {
login()
}
return view
}
private fun login() {
val email = binding.loginEmail.text.toString()
val password = binding.loginPassword.text.toString()
binding.llProgressBar.root.visibility = View.VISIBLE
auth.signInWithEmailAndPassword(email, password)
.addOnCompleteListener { task ->
if (task.isSuccessful) {
// Sign in success, update UI with the signed-in user's information
Log.d("AUTH", "signInWithEmail:success")
val intent = Intent(activity, StudentActivity::class.java)
activity?.startActivity(intent)
} else {
// If sign in fails, display a message to the user.
Log.w("AUTH", "signInWithEmail:failure", task.exception)
Toast.makeText(
context, "Authentication failed.",
Toast.LENGTH_SHORT
).show()
}
}
}
override fun onDestroyView() {
super.onDestroyView()
_binding = null
}
}

Check date(rules) in Firebase .

Related

Caused by: java.io.IOException: The Application Default Credentials are not available

I'm working on an android app that interfaces with a google sheet. I was following the api documentation for writing values to certain cells but I'm getting this error here:
Caused by: java.io.IOException: The Application Default Credentials are not available.
I have made sure to set my credentials in google cloud platform for my project and downloaded the .json file to src\main\resources in my android studio project.
here is the code that is supposed to write the data:
package com.example.frcscout22
import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.*
import androidx.fragment.app.Fragment
import com.google.api.client.http.HttpRequestInitializer
import com.google.api.client.http.javanet.NetHttpTransport
import com.google.api.client.json.gson.GsonFactory
import com.google.api.services.sheets.v4.Sheets
import com.google.api.services.sheets.v4.SheetsScopes
import com.google.api.services.sheets.v4.model.ValueRange
import com.google.auth.http.HttpCredentialsAdapter
import com.google.auth.oauth2.GoogleCredentials
import java.util.*
class Data : Fragment(R.layout.fragment_data) {
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
val spinner = view.findViewById<Spinner>(R.id.defense_spinner)
val aa = ArrayAdapter(requireContext(), android.R.layout.simple_spinner_item, resources.getStringArray(R.array.Defenses))
aa.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item)
spinner.adapter = aa
view.findViewById<Spinner>(R.id.defense_spinner).visibility = View.GONE
view.findViewById<TextView>(R.id.textView6).visibility = View.GONE
view.findViewById<EditText>(R.id.Team_Defended).visibility = View.GONE
}
override fun onCreateView(
inflater: LayoutInflater,
container: ViewGroup?,
savedInstanceState: Bundle?
): View? {
val view: View = inflater!!.inflate(R.layout.fragment_data, container, false)
val checkBox = view.findViewById<CheckBox>(R.id.checkBox)
checkBox.setOnCheckedChangeListener { buttonView, isChecked ->
if (isChecked) {
view.findViewById<Spinner>(R.id.defense_spinner).visibility = View.VISIBLE
view.findViewById<TextView>(R.id.textView6).visibility = View.VISIBLE
view.findViewById<EditText>(R.id.Team_Defended).visibility = View.VISIBLE
} else {
view.findViewById<Spinner>(R.id.defense_spinner).visibility = View.GONE
view.findViewById<TextView>(R.id.textView6).visibility = View.GONE
view.findViewById<EditText>(R.id.Team_Defended).visibility = View.GONE
}
}
val clear = view.findViewById<Button>(R.id.button2)
clear.setOnClickListener(View.OnClickListener {
view.findViewById<EditText>(R.id.Match_Number).setText("")
view.findViewById<EditText>(R.id.Team_Number).setText("")
view.findViewById<EditText>(R.id.Auto_Points).setText("")
view.findViewById<EditText>(R.id.Teleop_Points).setText("")
view.findViewById<EditText>(R.id.Endgame_Points).setText("")
view.findViewById<EditText>(R.id.Team_Defended).setText("")
view.findViewById<Spinner>(R.id.defense_spinner).setSelection(0)
view.findViewById<CheckBox>(R.id.checkBox).isChecked = false
})
val table : MutableList<MutableList<Any>> = mutableListOf(mutableListOf("test", "test2"))
val values = ValueRange()
values.majorDimension = "ROWS"
values.setValues(table)
val button = view.findViewById<View>(R.id.button)
button.setOnClickListener(View.OnClickListener {
setRow("1fs1U9-LMmkmQbQ2Kn-rNVHIQwh6_frAbwaTp7MSyDIA", "Sheet1!A1:B1", values)
})
// Return the fragment view/layout
return view
}
private fun setRow(spreadSheetID: String, range: String, values: ValueRange) {
val credentials: GoogleCredentials = GoogleCredentials.getApplicationDefault().createScoped(
Collections.singleton(
SheetsScopes.SPREADSHEETS))
val requestInitializer: HttpRequestInitializer = HttpCredentialsAdapter(credentials)
val service: Sheets = Sheets.Builder(NetHttpTransport(), GsonFactory.getDefaultInstance(), requestInitializer).setApplicationName("FRCScout22").build()
service.spreadsheets().values().update(spreadSheetID, range, values)
.setValueInputOption("USER_ENTERED")
.execute();
}
}
Does anyone know why I may be getting this error? Thanks!!
Application Default Credentials (ADC) is a process that looks for the credentials in various places including the env var GOOGLE_APPLICATION_CREDNTIALS.
If GOOGLE_APPLICATION_CREDNTIALS is unset ADC fails and raises an error.

lateinit variable not being initialized in a thread

So I'm working with the google sheets api in an android app and I'm trying to get the credentials in a separate thread. This is what I have:
GoogleSheets is a class I created to get credentials and cell values of my spreadsheet
private lateinit var sheets: GoogleSheets is a instance variable that I declare at the beginning of the class. I am trying to initialize here:
load.setOnClickListener(View.OnClickListener {
Thread {
sheets = GoogleSheets(requireContext(), "1fs1U9-LMmkmQbQ2Kn-rNVHIQwh6_frAbwaTp7MSyDIA")
}.start()
println(sheets)
println(sheets.getValues("A1"))
})
but It's telling me that the sheets variable hasn't been initialized:
kotlin.UninitializedPropertyAccessException: lateinit property sheets has not been initialized
here is the full class:
import android.Manifest
import android.content.Intent
import android.content.pm.PackageManager
import android.net.Uri
import android.os.Build
import android.os.Bundle
import android.os.Environment
import android.provider.Settings
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.Button
import android.widget.EditText
import androidx.activity.result.contract.ActivityResultContracts
import androidx.annotation.RequiresApi
import androidx.core.app.ActivityCompat
import androidx.core.content.ContextCompat
import androidx.fragment.app.Fragment
import com.example.frcscout22.GoogleSheets
import com.example.frcscout22.R
// TODO: AUTOMATICALLY SWITCH TO DATA TAB AFTER LOAD OR CREATE NEW
class Home: Fragment(R.layout.fragment_home) {
private lateinit var sheets: GoogleSheets
private val STORAGE_PERMISSION_CODE = 100
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
}
#RequiresApi(Build.VERSION_CODES.P)
override fun onCreateView(
inflater: LayoutInflater,
container: ViewGroup?,
savedInstanceState: Bundle?
): View? {
val view: View = inflater.inflate(R.layout.fragment_home, container, false)
val load = view.findViewById<Button>(R.id.button3)
val new = view.findViewById<Button>(R.id.button4)
val editText = view.findViewById<EditText>(R.id.editTextTextPersonName)
if (!checkPermission()) {
println("requested")
requestPermission()
}
new.setOnClickListener(View.OnClickListener {
val sheets = GoogleSheets(requireContext(),"1fs1U9-LMmkmQbQ2Kn-rNVHIQwh6_frAbwaTp7MSyDIA")
sheets.setValues("A1", "this is a test", "USER_ENTERED")
println(sheets.getValues("A1").values)
})
load.setOnClickListener(View.OnClickListener {
Thread {
sheets = GoogleSheets(requireContext(), "1fs1U9-LMmkmQbQ2Kn-rNVHIQwh6_frAbwaTp7MSyDIA")
}.start()
println(sheets)
println(sheets.getValues("A1"))
})
return view
}
private fun requestPermission(){
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R){
//Android is 11(R) or above
try {
val intent = Intent()
intent.action = Settings.ACTION_MANAGE_APP_ALL_FILES_ACCESS_PERMISSION
val uri = Uri.fromParts("package", requireActivity().packageName, "Home")
intent.data = uri
storageActivityResultLauncher.launch(intent)
}
catch (e: Exception){
val intent = Intent()
intent.action = Settings.ACTION_MANAGE_APP_ALL_FILES_ACCESS_PERMISSION
storageActivityResultLauncher.launch(intent)
}
}
else{
//Android is below 11(R)
ActivityCompat.requestPermissions(requireActivity(),
arrayOf(Manifest.permission.WRITE_EXTERNAL_STORAGE, Manifest.permission.READ_EXTERNAL_STORAGE),
STORAGE_PERMISSION_CODE
)
}
}
private val storageActivityResultLauncher = registerForActivityResult(ActivityResultContracts.StartActivityForResult()){
//here we will handle the result of our intent
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R){
//Android is 11(R) or above
if (Environment.isExternalStorageManager()){
//Manage External Storage Permission is granted
}
}
else{
//Android is below 11(R)
}
}
private fun checkPermission(): Boolean{
return if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R){
//Android is 11(R) or above
Environment.isExternalStorageManager()
}
else{
//Android is below 11(R)
val write = ContextCompat.checkSelfPermission(requireContext(), Manifest.permission.WRITE_EXTERNAL_STORAGE)
val read = ContextCompat.checkSelfPermission(requireContext(), Manifest.permission.READ_EXTERNAL_STORAGE)
write == PackageManager.PERMISSION_GRANTED && read == PackageManager.PERMISSION_GRANTED
}
}
}
I can't figure out why the varible isn't being initialized. Does it have something to do with it being in a thread? How can I fix this problem? Thanks!!
You're starting another thread to initialize it, so if you check for it immediately, the other thread hasn't had time to initialize the property yet. This is a misuse of lateinit and you are also failing to utilize thread synchronization, so it is susceptible to other bugs.
I suggest loading the sheet with a coroutine and using a suspend function to retrieve the instance when you need to use it anywhere. When using only coroutines to access the property, you don't need to worry about thread synchronization.
Really, this should go in a class that outlives the Fragment so you don't have to reload it every time the Fragment is recreated, but for simplicity, I'll just keep it in your Fragment for this example.
class Home: Fragment(R.layout.fragment_home) {
private val loadSheetsDeferred = viewLifecycle.lifecycleScope.async(Dispatchers.IO) {
GoogleSheets(requireContext(), "1fs1U9-LMmkmQbQ2Kn-rNVHIQwh6_frAbwaTp7MSyDIA")
}
private suspend fun getSheets(): GoogleSheets = loadSheetsDeferred.await()
private val STORAGE_PERMISSION_CODE = 100
#RequiresApi(Build.VERSION_CODES.P)
override fun onCreateView(
inflater: LayoutInflater,
container: ViewGroup?,
savedInstanceState: Bundle?
): View? {
//...
new.setOnClickListener { viewLifecycle.lifecycleScope.launch {
getSheets().setValues("A1", "this is a test", "USER_ENTERED")
println(getSheets().getValues("A1").values)
} }
load.setOnClickListener { viewLifecycle.lifecycleScope.launch {
println(getSheets())
println(getSheets().getValues("A1"))
} }
return view
}
//...
}
At a guess the error's telling you it's happening when you do this:
Thread {
sheets = GoogleSheets(requireContext(), "1fs1U9-LMmkmQbQ2Kn-rNVHIQwh6_frAbwaTp7MSyDIA")
}.start()
println(sheets)
lateinit is you promising the compiler you'll have assigned a value to sheets before anything tries to read it, which you're doing with println(sheets). You're assigning it in that thread you just started - but that's very unlikely to have completed before the println statement runs on the current thread!
You also have to worry about synchronisation if you're involving threading like this - just because your worker thread sets the value of sheets, it doesn't mean the current thread will see that updated value. You can have a look here if you're not familiar with that whole issue and the steps you have to take to ensure things stay consistent.
Your best bet with the code you have is to do your println stuff inside the thread after sheets is assigned. If you do anything more complicated than that, and need to get back on the main thread, you can post a Runnable on a view. Honestly, if you can use coroutines instead that would probably make your life easier in the long run

Method setCurrentState must be called on the main thread, Android, Kotlin

Android studio shows errors in the lines
REPOSITORY.insert(note){ onSuccess() }
in the "AddNewNoteFragmentViewModel" and in the lines
viewModel.insert(AppNote(name = name, text = text)){ view?.findNavController()?.navigate(R.id.action_addNewNoteFragment_to_mainFragment)}
in the file "AddNewNoteFragment"
I realized that the error is related to streams, but I do not know how to solve it
If anyone knows, please help, I could not find anything worthwhile on the Internet
AddNewNoteFragment
package com.example.notes.fragments.add_new_note
import android.os.Bundle
import androidx.fragment.app.Fragment
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.lifecycle.ViewModelProvider
import androidx.navigation.findNavController
import com.example.notes.R
import com.example.notes.databinding.FragmentAddNewNoteBinding
import com.example.notes.model.AppNote
import com.example.notes.utilits.showToast
class AddNewNoteFragment : Fragment() {
private var _binding: FragmentAddNewNoteBinding? = null
val binding get() = _binding!!
private lateinit var viewModel: AddNewNoteFragmentViewModel
override fun onCreateView(
inflater: LayoutInflater, container: ViewGroup?,
savedInstanceState: Bundle?
): View? {
_binding = FragmentAddNewNoteBinding.inflate(inflater, container, false)
val view = binding.root
return view
}
override fun onStart() {
super.onStart()
initialization()
}
private fun initialization() {
viewModel = ViewModelProvider(this).get(AddNewNoteFragmentViewModel::class.java)
binding.buttonAddNote.setOnClickListener {
val name = binding.inputNameNote.text.toString()
val text = binding.inputTextNote.text.toString()
if (name.isEmpty()){
showToast("Введите имя заметки")
} else{
viewModel.insert(AppNote(name = name, text = text)){
view?.findNavController()?.navigate(R.id.action_addNewNoteFragment_to_mainFragment)
}
}
}
}
override fun onDestroyView() {
super.onDestroyView()
_binding = null
}
}
AddNewNoteFragmentViewModel
package com.example.notes.fragments.add_new_note
import android.app.Application
import androidx.lifecycle.AndroidViewModel
import androidx.lifecycle.viewModelScope
import com.example.notes.model.AppNote
import com.example.notes.utilits.REPOSITORY
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.launch
class AddNewNoteFragmentViewModel(application: Application): AndroidViewModel(application) {
fun insert(note: AppNote,onSuccess:()-> Unit) =
viewModelScope.launch (Dispatchers.IO){
REPOSITORY.insert(note){
onSuccess()
}
}
}
Error screen
enter image description here
Problem solved
In AddNewNoteFragmentViewModel requires Dispatchers.IO to be changed to Dispatchers.Main

Viewmodel factory? is it something i need?

I am programing an app in kotlin using MVVM structur. i tried to instantiate my viewmodel through my factory. Though im getting an error when i start the app. It says this `
java.lang.RuntimeException: Cannot create an instance of class com.example.paperseller.ui.menu.ViewModels.AuthViewModel
I have no clue at all why im getting this trouble. My code looks like this
I have already tried to skip the factory implementation.
I would not use this way of implementing mvvm in kotlin nowadays. I would take a look at renewed tutorials 2021.
LoginRegister_fragment:
package com.example.paperseller.ui.menu
import android.os.Bundle
import androidx.fragment.app.Fragment
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.Button
import android.widget.EditText
import android.widget.Toast
import androidx.fragment.app.activityViewModels
import androidx.fragment.app.viewModels
import androidx.lifecycle.ViewModel
import androidx.lifecycle.ViewModelProvider
import com.example.paperseller.Data.User
import com.example.paperseller.R
import com.example.paperseller.databinding.LoginRegisterFragmentBinding
import com.example.paperseller.ui.menu.ViewModels.AuthViewModel
class LoginRegister_fragment : Fragment(R.layout.login_register_fragment) {
private var _binding : LoginRegisterFragmentBinding? = null
private val binding get() = _binding!!
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View?
{
_binding = LoginRegisterFragmentBinding.inflate(inflater, container, false)
return binding.root
}
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
initializeUI()
}
private fun initializeUI()
{
val factory = InjectorUtils.providePaperSellerViewModelFactory()
val viewModel : AuthViewModel by viewmodels()
viewModel.message.observe(this)
{
message ->
Toast.makeText(requireActivity(), message, Toast.LENGTH_LONG).show()
}
binding.registerButton.setOnClickListener()
{
val user = User(binding.emailText.text.toString(), binding.passwordText.text.toString());
viewModel.register(user)
}
}
override fun onDestroy() {
super.onDestroy()
_binding = null
}
}
ViewModelFactory:
package com.example.paperseller.ui.menu.ViewModelFactory
import androidx.lifecycle.ViewModel
import androidx.lifecycle.ViewModelProvider
import com.example.paperseller.Data.PaperSellerRepository
import com.example.paperseller.ui.menu.ViewModels.AuthViewModel
class PaperSellerViewModelFactory(private val paperSellerRepository: PaperSellerRepository) : ViewModelProvider.NewInstanceFactory()
{
#Suppress("UNCHECKED_CAST")
override fun <T:ViewModel?> create(modelClass: Class<T>):T{
return AuthViewModel(paperSellerRepository) as T
}
}
I tried to follow this tutorial:
https://resocoder.com/2018/09/07/mvvm-on-android-crash-course-kotlin-
This tutorial is 4 years old. Tip to people seeing this question later. Check tutorials on youtube that is up to date this helped me alot.
Your ViewModel takes in a repository and since then You have to use the ViewModelFactory. You can either use ViewModelProvider:
val factory = InjectorUtils.providePaperSellerViewModelFactory()
val viewModel = ViewModelProvider(
this,
factory)
.get(AuthViewModel::class.java)
or, as #IR42 has pointed out, You can use viewModels delegate:
val viewModel: AuthViewModel by viewModels { factory }

Why can't I use an intent to transition back to a previous fragment in my Android app?

I make a transition from a fragment to an activity but I am unable to transition back to the fragment without my app crashing.
Here is my fragment code:
package com.riverstonetech.gositeuk.ui.scotland
import android.content.Intent
import android.os.Bundle
import android.util.Log
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.ArrayAdapter
import android.widget.ProgressBar
import androidx.fragment.app.Fragment
import com.google.firebase.firestore.FirebaseFirestore
import com.riverstonetech.gositeuk.CountriesActivity
import com.riverstonetech.gositeuk.R
import com.riverstonetech.gositeuk.RegionActivity
import kotlinx.android.synthetic.main.fragment_scotland.*
class ScotlandFragment : Fragment() {
// Access a Cloud Firestore instance
val db = FirebaseFirestore.getInstance()
lateinit var adapter : ArrayAdapter<String>
override fun onCreateView(
inflater: LayoutInflater,
container: ViewGroup?,
savedInstanceState: Bundle?
): View? {
val root = inflater.inflate(R.layout.fragment_scotland, container, false)
(requireActivity() as CountriesActivity).initializeCustomActionBar(R.drawable.scotland_flag, R.string.title_regions)
var regions : ArrayList<String>
val docRef = db.collection("UKSites").document("Scotland")
val progressBar: ProgressBar = root.findViewById(R.id.regionsLoadingProgressBar)
docRef.get()
.addOnSuccessListener { document ->
progressBar?.visibility = ProgressBar.VISIBLE
if (document != null) {
regions = document.get("Regions") as ArrayList<String>
adapter = ArrayAdapter(requireContext(), R.layout.list_item, regions)
regionsListView.adapter = adapter
regionsListView.setOnItemClickListener { parent, view, position, id ->
val intent = Intent(activity!!, RegionActivity::class.java)
intent.putExtra("SUB_COUNTRY", regions[position])
startActivity(intent)
}
progressBar?.visibility = ProgressBar.GONE
} else {
Log.d("Debug", "No such document")
}
}
.addOnFailureListener { exception ->
Log.d("Debug", "get failed with ", exception)
}
return root
}
}
And here is the relevant code in my activity class RegionActivity:
fun previousSubCountryListButtonClicked(view: View) {
val intent: Intent = Intent(this, ScotlandFragment::class.java)
startActivity(intent)
}
Here is the error output in the logcat window:
2020-02-10 15:46:54.089 27008-27008/com.riverstonetech.gositeuk E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.riverstonetech.gositeuk, PID: 27008
java.lang.IllegalStateException: Could not execute method for android:onClick
at androidx.appcompat.app.AppCompatViewInflater$DeclaredOnClickListener.onClick(AppCompatViewInflater.java:402)
I don't have enough knowledge of fragments and activity to work out why this doesn't work so any help would be appreciated.
You are making this way more complicated than it needs to be.
To return from RegionActivity to the previous Activity/Fragment, you just need to call finish(). That will destroy RegionActivity and return to whatever Activity was underneath it, in the same state it was in when you launched RegionActivity.
I used finish() instead of trying to switch to the fragment using intents.

Categories

Resources