• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps Android - popout window

lainel

Lurker
[HIGH]@Override
publicvoid onItemClick(AdapterView<?> parent,View view,int position,long id){
view.performHapticFeedback(HapticFeedbackConstants.VIRTUAL_KEY);

switch((int)id ){case0:
changeMenuFrag(newSearch());//break;case1:
changeMenuFrag(newInfo());break;case2:
getActivity().findViewById(R.id.btn_lotview).performClick();break;}}[/HIGH]

Hi all, I am trying to create a popout window at my main menu which is the above class and my case 2.performClick doesnt work. Below is my popout window activity class which is workable. Please guide as how should I do?

[HIGH]public class MainActivity extends Activity{
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState{
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);

finalButton btnOpenPopup =(Button)findViewById(R.id.openpopup);
btnOpenPopup.setOnClickListener(newButton.OnClickListener(){

@Override
public void onClick(View arg0){LayoutInflater layoutInflater
=(LayoutInflater)getBaseContext().getSystemService(LAYOUT_INFLATER_SERVICE);
View popupView = layoutInflater.inflate(R.layout.popup,null);
finalPopupWindow popupWindow =newPopupWindow(
popupView,LayoutParams.WRAP_CONTENT,LayoutParams.WRAP_CONTENT);

Button btnDismiss =(Button)popupView.findViewById(R.id.dismiss);
btnDismiss.setOnClickListener(newButton.OnClickListener(){

@Override
public void onClick(View v){// TODO Auto-generated method stub
popupWindow.dismiss();}});

popupWindow.showAsDropDown(btnOpenPopup,50,-30);
}});}}[/HIGH]
 
Back
Top Bottom