FORUMS

OnePlus 2 Forums: Discuss Everything About The OP2!

Now that the OnePlus 2 has been officially unveiled and that we have had close-up … more

Intel & Micron Announce “Revolutionary” Storage Tech

Intel & Micron have announced 3D Xpoint technology—”the … more

Google Now Interfaces With Third-Party Messaging Apps

Google has announced that Ok Google voice commands can now be used to send … more

Make Your Lockscreen More Productive With Widgets

Are you running Android Lollipop? Do you miss the ability to add widgets to your lock … more

onlcick drawer navigation start new activity

6 posts
Thanks Meter: 0
 
By canempire, Junior Member on 21st May 2014, 11:48 PM
Post Reply Subscribe to Thread Email Thread
2nd June 2014, 11:44 AM |#11  
gh0stslayer's Avatar
Senior Member
Flag Bangalore
Thanks Meter: 255
 
More
Quote:
Originally Posted by canempire

FragmentVue1 isi an Activity it is FragmentVue1.java and the code is

PHP Code:
package com.projectmockup.cypruscityguide;
import com.projectmockup.cypruscityguide.R;
import android.app.Activity;
import android.os.Bundle

public class 
FragmentVue1 extends Activity{
    protected 
void onCreate(Bundle savedInstanceState){
        
super.onCreate(savedInstanceState);
        
setContentView(R.layout.hotel);
    }


please help when i start the application the Fragment_main.xml is empty but before i use this code in MainActivity
PHP Code:
case 1:
            
//To start a new activity
            
Intent intent = new Intent(this,FragmentVue1.class);
            
startActivity(intent);
            break; 
the content of Fragment_main.xml was visible
i check below in the MainActivity and i found this code with alert
PHP Code:
    private void beginTransaction() { // WARNING: The method beginTransaction() from the type MainActivity is never used locally
        // TODO Auto-generated method stub
        
    
}

    private 
FragmentManager getSupportFragmentManager() {//WARNING:The method getSupportFragmentManager() from the type MainActivity is never used locally
        // TODO Auto-generated method stub
        
return null;
    } 

You don't need to add these lines, they are for opening a fragment. I just provided them to help you know how to open a fragment from navigation drawer.
 
 
Post Reply Subscribe to Thread
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes