-
-
Save anonymous/9683d29144af026e22da to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.example.navigationdrawerdemo; | |
import android.app.Fragment; | |
import android.content.Intent; | |
import android.os.Bundle; | |
import android.view.LayoutInflater; | |
import android.view.View; | |
import android.view.ViewGroup; | |
import android.widget.Button; | |
import android.widget.ImageButton; | |
public class FragmentSearch extends Fragment { | |
ImageButton imgbtn1; | |
@Override | |
public void onCreate(Bundle savedInstanceState) | |
{ | |
// TODO Auto-generated method stub | |
super.onCreate(savedInstanceState); | |
imgbtn1=(ImageButton) getView().findViewById(R.id.imageButton1); | |
imgbtn1.setOnClickListener(Listener); | |
} | |
private Button.OnClickListener Listener = new Button.OnClickListener(){ | |
@Override | |
public void onClick(View v) { | |
Intent intent=new Intent(); | |
switch(v.getId()) | |
{ | |
case R.id.imageButton1: | |
intent.setClass(getActivity(),FragmentSet.class); | |
getActivity().startActivity(intent); | |
break; | |
} | |
} | |
}; | |
@Override | |
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { | |
return initView(inflater, container); | |
} | |
private View initView(LayoutInflater inflater, ViewGroup container) { | |
View view = inflater.inflate(R.layout.fragment_search, container, false); | |
return view; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment