Android之通过category跳转到指定的Activity



    





    



package com.example.test21;

import android.support.v7.app.ActionBarActivity;
import android.content.Intent;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;

public class MainActivity extends ActionBarActivity {

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_main);
		
	}
	
	public void bntOnclick(View view){
		Intent intent=new Intent();
		intent.setAction("mayangyang.action.three");
		intent.addCategory("mayangyang.category.test");
		startActivity(intent);
	}
}




    

    
        
            
                

                
            
        
        
            
                
				
                
            
        
        
            
                

                
            
        
    



你可能感兴趣的:(android)