Android TV Launcher Pushed to Google Play

Over the past decade, the tech universe has seen two drastic and widely contrasting changes with … more

Cyngn, OnePlus, Micromax – The Legal Battle

Recently, a battle has been waging in India over the rights to distribute the commercial … more

Lean Mean Battery Power Saving App Review

We talk a lot about battery topics here at XDA TV. We talk about everything from Power Banks to USB … more

Android 5.1 Possibly Coming February 2015

Google released Android 5.0 just over a month ago, and since then Lollipop has been trying to … more

Welcome to XDA

Search to go directly to your device's forum

Register an account

Unlock full posting privileges

Ask a question

No registration required
Post Reply

onlcick drawer navigation start new activity

OP canempire

2nd June 2014, 12:44 PM   |  #11  
gh0stslayer's Avatar
Senior Member
Flag Bangalore
Thanks Meter: 206
 
261 posts
Join Date:Joined: Nov 2010
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