How to run a certain activity in Android Studio?

后端 未结 6 1145
渐次进展
渐次进展 2021-02-04 01:31

For instance, I have a few activities within one app, and in order to see a certain activity\'s UI or whatever, I need to run a certain activity that is not the launcher of the

6条回答
  •  夕颜
    夕颜 (楼主)
    2021-02-04 01:53

    First you need to have two or more activities in your app to start with. Let's say you want to go to a certain activity in your app to display first. May be for testing purposes or any other. Let's see how it can be done, First you need to find the AndroidManifest.xml file. Its there under the manifests folder. According to this first dispaly activity is MainActivity

    Lets's say I want to make the home activity display first. So what I have to do is simply cut the intent-filter.../intent-filter and paste it within home activity. Like this

    First Displaying Acivity is MainActivity according to this,

    
            
            
            
                
                    
                    
                
            
        

    When we want to make the home acivity display first simplay change it as this,

    
            
                
                    
                    
                
            
            
            
        

    This should work. Hope this will help

提交回复
热议问题