Re: [android-developers] Navigation Fragment Switching

2016-06-09 Thread Cross Stitch
just so everyone knows..mykyru Wolf, and me are the same person, however 
from here on out i will be using this account i am also reposting this 
issue with the proper links and all.. so look for it under this name


On Thursday, June 9, 2016 at 3:03:48 AM UTC-7, Mykyru Wolf wrote:
>
> So first, I'm sorry for the confusion. As I explained in a previous reply, 
> I'm an intermediate programmer, so I'm  not aware of all useful links and 
> lingo. Second, my intent is to do an OnMenuItemSelect, open a fragment 
> layout as an activity in the main activity screen.. so when I click a menu 
> option, the home screen fades to the back, and that menu items 
> corresponding fragment comes to the front with full functional 
> interactivity..if that makes sense.

-- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
To post to this group, send email to android-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/android-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/android-developers/cf9b7ee4-6bb7-473b-9b32-ebe91d22dff5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [android-developers] Navigation Fragment Switching

2016-06-09 Thread Mykyru Wolf
So first, I'm sorry for the confusion. As I explained in a previous reply, I'm 
an intermediate programmer, so I'm  not aware of all useful links and lingo. 
Second, my intent is to do an OnMenuItemSelect, open a fragment layout as an 
activity in the main activity screen.. so when I click a menu option, the home 
screen fades to the back, and that menu items corresponding fragment comes to 
the front with full functional interactivity..if that makes sense.

-- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
To post to this group, send email to android-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/android-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/android-developers/cede51ec-f102-4e01-ae78-cc1aaa0f4402%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [android-developers] Navigation Fragment Switching

2016-05-26 Thread TreKing
On Sat, Mar 12, 2016 at 2:55 PM, Mykyru Wolf  wrote:

> I'm trying to set up my nav drawer so when an item gets clicked in the
> menu, it opens a new fragment for that specified activity inside of my home
> layout. My code I currently have is attached, and any help would be
> appreciated.


First, please clarify your intent. Are you trying to replace a fragment
within one activity that has a drawer?
Or open new activities as you click things in the drawer list?

Second, what, *exactly*, is the problem you're having and need help with?

-
TreKing  - Chicago
transit tracking app for Android-powered devices

-- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
To post to this group, send email to android-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/android-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/android-developers/CANCScgjvyN9JQ7pyAKU0gH%2BpPG77KixNHWaF%2B%2BbawN39OQ6v4g%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[android-developers] Navigation Fragment Switching

2016-03-12 Thread Mykyru Wolf
Hey everyone, having some trouble trying to call upon a fragment to add a 
new activity to my nav drawer layout. I'm trying to set up my nav drawer so 
when an item gets clicked in the menu, it opens a new fragment for that 
specified activity inside of my home layout. My code I currently have is 
attached, and any help would be appreciated.
I am a beginner/intermediate programmer and would like any help and advice 
I can get.

 

-- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
To post to this group, send email to android-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/android-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/android-developers/8ab3537c-b671-4f5a-b7c1-5ff5b46f2f9a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
package com.weebly.httpmykyrutech.the_echo;

import android.content.Context;
import android.net.Uri;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;



public class arts_and_entertainment extends Nav_Drawer {

// TODO: Rename parameter arguments, choose names that match
// the fragment initialization parameters, e.g. ARG_ITEM_NUMBER


private OnFragmentInteractionListener mListener;
private Fragment FragmentTransaction;

public arts_and_entertainment() {
// Required empty public constructor
}


@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);

}

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container) {
// Inflate the layout for this fragment
return inflater.inflate(R.layout.fragment_arts_and_entertainment, 
container, false);
}

// TODO: Rename method, update argument and hook method into UI event
public void onButtonPressed(Uri uri) {
if (mListener != null) {
mListener.onFragmentInteraction(uri);
}
}

@Override
public void onAttach(Context context) {
super.onAttach(context);
if (context instanceof OnFragmentInteractionListener) {
mListener = (OnFragmentInteractionListener) context;
} else {
throw new RuntimeException(context.toString()
+ " must implement OnFragmentInteractionListener");
}
}

@Override
public void onDetach() {
FragmentTransaction.onDetach();
mListener = null;
}

public Fragment getArguments() {
return FragmentTransaction;
}

/**
 * This interface must be implemented by activities that contain this
 * fragment to allow an interaction in this fragment to be communicated
 * to the activity and potentially other fragments contained in that
 * activity.
 * 
 * See the Android Training lesson http://developer.android.com/training/basics/fragments/communicating.html;
 * >Communicating with Other Fragments for more information.
 */
interface OnFragmentInteractionListener {
// TODO: Update argument type and name
void onFragmentInteraction(Uri uri);
}
}
package com.weebly.httpmykyrutech.the_echo;

import android.content.Intent;
import android.os.Bundle;
import android.support.design.widget.NavigationView;
import android.support.v4.view.GravityCompat;
import android.support.v4.widget.DrawerLayout;
import android.support.v7.app.ActionBarDrawerToggle;
import android.support.v7.widget.Toolbar;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;

public abstract class Nav_Drawer extends home
implements NavigationView.OnNavigationItemSelectedListener {


@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.nav_header_home);
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
setSupportActionBar(toolbar);


DrawerLayout drawer = (DrawerLayout) 
findViewById(R.id.activity_home_nav_drawer);
ActionBarDrawerToggle toggle = new ActionBarDrawerToggle(
this, drawer, toolbar, R.string.navigation_drawer_open, 
R.string.navigation_drawer_close);
drawer.setDrawerListener(toggle);
toggle.syncState();

NavigationView navigationView = (NavigationView) 
findViewById(R.id.activity_home_nav_drawer);
navigationView.setNavigationItemSelectedListener(this);
}

@Override
public void onBackPressed() {
DrawerLayout drawer = (DrawerLayout) 
findViewById(R.id.activity_home_nav_drawer);
if