package com.android.tutor;
import android.app.Activity;
import android.content.Context;
import android.os.Bundle;
import android.view.Gravity;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup.LayoutParams;
import android.widget.Button;
import android.widget.ImageButton;
import android.widget.PopupWindow;
import android.widget.TextView;
import android.widget.Toast;
public class PopupWindowDemo extends Activity{
ImageButton img;
TextView tv;
PopupWindow mPopupWindow;
Button bt;
String str="";
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
bt=(Button)findViewById(R.id.bt);
bt.setOnClickListener(new View.OnClickListener()
{
@Override
public void onClick(View v) {
// TODO Auto-generated method stub
showPopupWindow();
}
});
}
public void showPopupWindow()
{
Context mContext = PopupWindowDemo.this;
LayoutInflater mLayoutInflater = (LayoutInflater) mContext
.getSystemService(LAYOUT_INFLATER_SERVICE);
View music_popunwindwow = mLayoutInflater.inflate(
R.layout.music_popwindow, null);
mPopupWindow= new PopupWindow(music_popunwindwow,
LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT);
mPopupWindow.showAtLocation(findViewById(R.id.main), Gravity.CENTER, 0, 0);
img=(ImageButton)music_popunwindwow.findViewById(R.id.control_play);
img.setOnClickListener(new View.OnClickListener()
{
@Override
public void onClick(View v)
{
secondPop();
}
});
}
public void secondPop()
{
Context mContext = PopupWindowDemo.this;
LayoutInflater mLayoutInflater = (LayoutInflater) mContext
.getSystemService(LAYOUT_INFLATER_SERVICE);
View second= mLayoutInflater.inflate(
R.layout.secondpopwindow, null);
PopupWindow mPopupWindow= new PopupWindow(second,
LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);
mPopupWindow.showAtLocation(findViewById(R.id.main), Gravity.CENTER, 0, 50);
ImageButton img1=(ImageButton)second.findViewById(R.id.control_play);
img1.setOnClickListener(new View.OnClickListener()
{
@Override
public void onClick(View v)
{
Toast.makeText(PopupWindowDemo.this, "second", Toast.LENGTH_LONG).show();
}
});
}
}
没有合适的资源?快使用搜索试试~ 我知道了~
Android应用源码之多级PopupWindow的小demo.zip项目安卓应用源码下载
共42个文件
png:14个
class:11个
xml:9个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 26 浏览量
2022-03-08
13:36:04
上传
评论
收藏 93KB ZIP 举报
温馨提示
Android应用源码之多级PopupWindow的小demo.zip项目安卓应用源码下载Android应用源码之多级PopupWindow的小demo.zip项目安卓应用源码下载 1.适合学生毕业设计研究参考 2.适合个人学习研究参考 3.适合公司开发项目技术参考
资源推荐
资源详情
资源评论
收起资源包目录
Android应用源码之多级PopupWindow的小demo.zip (42个子文件)
Android应用源码之多级PopupWindow的小demo
Android应用源码之多级PopupWindow的小demo
popwindow
popwindow
AndroidManifest.xml 686B
res
layout
music_popwindow.xml 3KB
main.xml 593B
secondpopwindow.xml 3KB
drawable-ldpi
icon.png 2KB
drawable
appwidget_button_center.xml 1KB
appwidget_button_left.xml 1KB
appwidget_button_right.xml 1KB
drawable-mdpi
icon.png 3KB
drawable-hdpi
appwidget_inner_focus_r.9.png 423B
ic_appwidget_music_next.png 489B
appwidget_bg.9.png 3KB
appwidget_inner_focus_l.9.png 400B
appwidget_divider.9.png 3KB
appwidget_inner_press_l.9.png 408B
appwidget_inner_press_r.9.png 419B
appwidget_inner_focus_c.9.png 221B
appwidget_inner_press_c.9.png 223B
icon.png 4KB
ic_appwidget_music_pause.png 232B
ic_appwidget_music_play.png 344B
values
strings.xml 181B
colors.xml 768B
src
com
android
tutor
PopupWindowDemo.java 2KB
bin
com
android
tutor
PopupWindowDemo$3.class 928B
R$color.class 398B
R.class 571B
PopupWindowDemo.class 2KB
R$layout.class 469B
R$attr.class 337B
R$id.class 671B
R$string.class 424B
PopupWindowDemo$2.class 797B
PopupWindowDemo$1.class 821B
R$drawable.class 1KB
classes.dex 5KB
popwindow.apk 30KB
resources.ap_ 25KB
.classpath 280B
default.properties 449B
.project 851B
gen
com
android
tutor
R.java 2KB
共 42 条
- 1
资源评论
yxkfw
- 粉丝: 76
- 资源: 2万+
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功