E-COM-NET
首页
在线工具
Layui镜像站
SUI文档
联系我们
推荐频道
Java
PHP
C++
C
C#
Python
Ruby
go语言
Scala
Servlet
Vue
MySQL
NoSQL
Redis
CSS
Oracle
SQL Server
DB2
HBase
Http
HTML5
Spring
Ajax
Jquery
JavaScript
Json
XML
NodeJs
mybatis
Hibernate
算法
设计模式
shell
数据结构
大数据
JS
消息中间件
正则表达式
Tomcat
SQL
Nginx
Shiro
Maven
Linux
getActivity
DialogFragment 获取context
最靠谱的方式是在@Override publicvoidonAttach(Activityactivity){ mContext=activity; super.onAttach(activity); } 直接使用
getActivity
jushenziao
·
2016-03-09 13:00
Android PendingIntent小结
PendingIntent的实例可以通过
getActivity
(Context,int,Intent,int),getActivities(Context,int,Intent[],i
six_moon
·
2016-03-07 11:00
Fragment Fragment生命周期 Fragment详解 Fragment生命周期详解
生命周期详解activity和fragment的对比onAttach()这个是回调函数这个时候activity已经传进来了,获得activity的传递的值就可以进行与activity的通信里当然也可以使用
getActivity
随意而然
·
2016-03-02 13:49
android
Fragment
Fragment Fragment生命周期 Fragment详解 Fragment生命周期详解
生命周期详解activity和fragment的对比onAttach()这个是回调函数这个时候activity已经传进来了,获得activity的传递的值就可以进行与activity的通信里当然也可以使用
getActivity
menglele1314
·
2016-03-02 13:00
android
Fragment
Fragment生命周期
fragment详解
Fragment生命周期详解
Fragment和Activity交互
通常情况下,我们都是通过如下代码进行交互的ViewlistView=
getActivity
().findViewById(R.id.list); ExampleFragmentfragment=(ExampleFragment
lxj1137800599
·
2016-03-01 12:00
简易发送短信app
SMSManager管理器 smsmanager=SmsManager.getDefault();2,//创建一个PendingIntent对象 PendingIntentpi=PendingIntent.
getActivity
tuke_tuke
·
2016-02-25 17:00
smsmanager
发送短信
Android 实现通知栏显示多个notification
中的要保持不一样;如果id值一样,那么就把之前的notify覆盖更新为当期最新的;2、点击notification进入到activity,使用到pendingIntent类方法,PengdingIntent.
getActivity
guowei0502
·
2016-02-25 15:06
Android
Fragment调用Activity中的方法,很简单
的类名叫ParentActivity,有一个test()方法在Fragment中调用其实很简单,代码如下:ParentActivity parentActivity=(ParentActivity )
getActivity
spt_dream
·
2016-02-25 10:00
Activity
父类
Fragment
系统管理
android 帮助页面
finalViewGroupdecorView=(ViewGroup)
getActivity
().getWindow().getDecorView().findViewById(android.R.id.content
殿小三
·
2016-02-19 14:32
android设置状态栏透明
样子就是上面的样子设置状态栏背景状态的方法privatevoidsetTranslucentStatus(){if(Build.VERSION.SDK_INT>=Build.VERSION_CODES.KITKAT){Windowwin=
getActivity
未来已来_feature
·
2016-02-18 15:25
android移动开发
android setCookie 免登录
CookieSyncManager.createInstance(
getActivity
());CookieManagercookieManager=CookieManager.getInstance(
齐永强2012
·
2016-02-17 17:00
Android系统提示对话框实现
直接看代码:newAlertDialog.Builder(
getActivity
()).setTitle("系统提示!")//设置对话框标题.setMessage("是否删除当前信息?")
qq_16630121
·
2016-02-16 16:31
安卓
RecyclerView使用总结
1、RecyclerView用途:实现ListView,GridView,瀑布流2、RecyclerView用法:rv.setLayoutManager(newLinearLayoutManager(
getActivity
annieliu502
·
2016-02-15 16:04
Android
6.后台任务封装
){ Stringtext=etName.getText().toString().trim(); if(TextUtils.isEmpty(text)){ ToastUtil.show(
getActivity
还没入行的菜鸟
·
2016-02-13 17:00
android的Afinal框架下的数据库更新
创建FinalDb对象时使用如下的构造函数,监听版本号的变化:db=FinalDb.create(
getActivity
(),"chat.db",true,3,dbUpdateListener);然后重写
灯火、阑珊处
·
2016-02-03 11:00
android的Afinal框架下的数据库更新
创建FinalDb对象时使用如下的构造函数,监听版本号的变化:db=FinalDb.create(
getActivity
(),"chat.db",true,3,dbUpdateListener);然后重写
灯火、阑珊处
·
2016-02-03 11:00
在Fragment里获得Activity里的方法
例如Activity叫MainActivity在Fragment里MainActivityact=(MainAcivity)
getActivity
就可以act.方法了
Jamsm
·
2016-01-27 17:00
android中的MD5、Base64、DES/3DES/ADES加解密
MD5摘要算法:主要代码:Strings=edit.getText().toString(); if(TextUtils.isEmpty(s)){ Toast.makeText(
getActivity
(
lzq520210
·
2016-01-27 15:00
Android的EditText在怎样获取焦点并弹出软键盘
commentEditText.setFocusableInTouchMode(true); commentEditText.requestFocus(); //打开软键盘 InputMethodManagerimm=(InputMethodManager)
getActivity
oQiHaoGongYuan
·
2016-01-26 17:00
Android开发
关于notification的使用,setLatestEventInfo方法在新SDK不能使用的解决方法
newNotification(R.mipmap.icon_demo,"通知测试",System.currentTimeMillis());notification2.setLatestEventInfo(
getActivity
BruceHurrican
·
2016-01-23 22:16
android学习笔记
在adapter中动态删除item,并刷新界面。
MomentAdapteradapter=newMomentAdapter(
getActivity
(),list); ptrlv.setAdapter(adapter);2.在adapter的getView
violetjack0808
·
2016-01-22 14:00
从其他Fragment后退时ViewPager出现空白页
解决方法:用getChildFragmentManager()去替代getFragmentManager()或者
getActivity
().getSupportFragmentManager()
Ben67
·
2016-01-21 17:00
viewpager
回退
空白页
WebView展示页面并交互
使用WebView展示一个PHP的页面,并在页面的最底部有一个可以回复的输入框 //设置底部输入框正常弹出避免被软键盘遮住
getActivity
().getWindow().setSoftInputMode
wxynxyo
·
2016-01-19 14:00
Android应用内打开QQ聊天框
wpa&uin=1611212383"; startActivity(newIntent(Intent.ACTION_VIEW,Uri.parse(url)));应用内跳到微信Intentintent=
getActivity
xiaoguiyixue
·
2016-01-19 10:00
Android Fragment
getActivity
null 解决
解决这个办法:直接在activity.onsaveinstance那里直接把重写:@Override protected void onSaveInstanceState(Bundle outState) { // TODO Auto-generated method stub //super.onSaveInstanceState(outState); }这样的话,就fragment就会直接跟a
SamZel
·
2016-01-18 11:00
android 给界面加指定的字体
assets的fonts的文件夹下,如下图:2.第二步就是找到你需要设置字体的textview或者其他的界面控件,加上如下代码即可:Typefaceface=Typeface.createFromAsset(
getActivity
omayyouhappy
·
2016-01-18 10:00
android
字体
android 动态设置background颜色
TableRowrow1=newTableRow(
getActivity
()); row1.setBackgroundColor(Color.parseColor("#9AD9EA"));android
li740207611
·
2016-01-14 09:00
android
background
颜色
动态设置
单选菜单
privatevoidsingelDialog(finalStringfileName,finalintpermission){ AlertDialog.Builderbuilder=newAlertDialog.Builder(
getActivity
li740207611
·
2016-01-13 21:00
android
singleChoi
弹出单选菜单
多选弹出菜单
choicepermission */ privatevoidmulDialog(finalStringfileName) { AlertDialog.Builderbuilder=newAlertDialog.Builder(
getActivity
li740207611
·
2016-01-13 21:00
android
多选弹出菜单
mulDialog
Picasso 加载图片到RelativeLayout之解决方案
Picasso加载图片到ImageView或者自己的自定义View都是可以直接调用对应API的,但是用into(0直接也加载到RelatieLayout就不好使了,可以这样来:Picasso.with(
getActivity
狂奔的小狮子
·
2016-01-12 19:00
往手机通知栏发送一条通知
NotificationManager)this .getSystemService(Context.NOTIFICATION_SERVICE); PendingIntentpendingIntent3=PendingIntent.
getActivity
cao185493676
·
2015-12-31 11:00
Android —— NFC详解
获取默认的NFC控制器 mAdapter=NfcAdapter.getDefaultAdapter(this);2.PendingIntentmPendingIntent=PendingIntent.
getActivity
womengmengyan
·
2015-12-28 17:00
Dialog仿iphone风格
第一种:privatevoidshowDialog(){ finalDialogdialog=newDialog(
getActivity
(),R.style.dialog); //设置它的
cao185493676
·
2015-12-24 15:00
设计模式-3-建造者模式(Builder Pattern)
中也是非常的常见的,比如: /** * 给宝贝拨打电话 * * @param no */ private void CallBaby() { new AlertDialog.Builder(
getActivity
iSnowFlake
·
2015-12-22 12:00
设计模式
Pattern
builder
建造者模式
Android之Fragment学习(四)
Fragment与Activity通信:(1)Fragment可以调用
getActivity
()方法获取它所在的Activity。
u014230923
·
2015-12-20 21:00
android
Fragment
Recyclerview 实现上拉加载更多
LinearLayoutManagerlayoutManager; layoutManager=newLinearLayoutManager(
getActivity
()); layoutManager.setOrientation
freexiaoyu
·
2015-12-16 15:00
判断一个时间段是否与另一时间段相冲突
privatebooleanisNotInclude(intnowFrom,intnowTo,intoldFrom,intoldTo){ if((nowFromoldFrom){ Toast.makeText(
getActivity
qq_31116683
·
2015-12-15 15:00
在fragment中用代码声明控件
publicViewonCreateView(LayoutInflaterinflater,ViewGroupcontainer, BundlesavedInstanceState){ T.showShort(
getActivity
____追梦人
·
2015-12-12 08:00
使用代码构建布局及设置常用属性
先来看一个布局: RelativeLayoutrelativeLayout=newRelativeLayout(
getActivity
()); ViewGroup.MarginLayoutParamslayou
Langxingtianxi
·
2015-12-11 18:00
android
布局
蒙板引导页面
示例代码:FrameLayoutframeLayout=(FrameLayout)
getActivity
().findV
crazyman2010
·
2015-12-10 15:00
android
Fragment和Activity的交互
fragment可以通过
getActivity
() 方法来获得Activity的实例,然后就可以调用一些例如findViewById()之类的方法。
qibanxuehua
·
2015-12-09 09:00
SwipeRefreshLayout 和RecyclerView 使用
使用是布局 ViewCodeLinearLayoutManagerlayoutManager=newLinearLayoutManager(
getActivity
()); layoutManager.setOrientation
freexiaoyu
·
2015-12-05 23:00
Java里计算两个同一天的时间间隔的小时数,并保留一位小数
SimpleDateFormatsdf=newSimpleDateFormat("hh:mm"); Datetime=sdf.parse(activityVO.
getActivity
().getActiveStartTime
中华好儿孙
·
2015-12-04 10:00
java
时间差
Activity常用跳转效果
Activity的切换需要在startActivity()或finish()函数之后紧跟函数(Fragment开头加
getActivity
(),其他的将Context的对象强转为Activity):
tianmaxingkong_
·
2015-11-28 17:00
数据存储
SharedPreferences存储位置:data/data/包名/shared-prefs存储类型有限:基本数据类型+String+set写数据SharedPreferencessharedPref=
getActivity
xiong_hui_hui
·
2015-11-26 17:00
android
数据存储类型
Android PendingIntent的
getActivity
()、getBroadcast()、getService()方法的区别
pendingIntent是一种特殊的Intent。主要的区别在于Intent的执行立刻的,而pendingIntent的执行不是立刻的。pendingIntent执行的操作实质上是参数传进来的Intent的操作,但是使用pendingIntent的目的在于它所包含的Intent的操作的执行是需要满足某些条件的。主要的使用的地方和例子:通知Notificatio的发送,短消息SmsManager的
yangan
·
2015-11-26 16:00
Notification使用以及PendingIntent.
getActivity
()
目录(?)[-]publicstaticPendingIntentgetActivityContextcontextintrequestCodeIntentintentintflagsParametersReturns publicvoidsendNotification(Contextctx,Stringmessage){ //getthenotificationmanager Strin
yangan
·
2015-11-26 15:00
(转载)深入PendingIntent
要得到一个pendingIntent对象,使用方法类的静态方法
getActivity
(Context,int,Intent,int),getBroadcast(Context,int,Intent,int
kongchengjiumenghx
·
2015-11-14 23:00
Volley框架之使用GET或POST将cookie传给服务器
throwsAuthFailureError具体方法如下:privatevoidVolleyGETCredit(){ Stringurl="你的网址"; RequestQueuequeue=Volley.newRequestQueue(
getActivity
u013003052
·
2015-11-13 22:00
volley上传cookie
同时显示多个 Notification
主要出在PendingIntent.
getActivity
();的第二个参数,API文档里虽然说是未被使用的参数(给出的例子也直接写0的),实际上是通过该参数来区别不同的Intent的,如果id相同,就会覆盖掉之前的
·
2015-11-13 15:46
notification
上一页
12
13
14
15
16
17
18
19
下一页
按字母分类:
A
B
C
D
E
F
G
H
I
J
K
L
M
N
O
P
Q
R
S
T
U
V
W
X
Y
Z
其他