或onStart或onResume也不行。
求解。
求解。
解决方案 »
- android中引用jsip包 命名空间javax.****与安卓系统冲突 ,refactory修改过路径之后,类型转换出错了!
- 如何判断手机先用网络是否连接至 服务器。
- 关于Android suspend的问题,请大家指点
- handler的不解
- android 怎么播放rtsp://110.80.31.70:6000/channe1
- 跪求android的wifi调试高手指点一下
- 学习Android的步骤!比如mvc 先v在c后m,一步一步,求总结!越详细越好!
- 如何通过点击listview中的item来获取item的详细信息
- ubuntu 下android模拟器运行一直是黑屏?
- 菜鸟求助 环信 Unknown Source
- 关于android 4.1「最近使用过应用程序」按钮的操作代码
- getaddrinfo.c里面怎么增加调试语句?
定义如下:
imageView.setBackgroundResource(R.drawable.anim_list);
animationDrawable=(AnimationDrawable)imageView.getBackground();
---------------放在一个监听器就能播放动画--------------------------------
imageView.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
// TODO Auto-generated method stub
animationDrawable.start();
}
});
---------------放在一个onCreate里就不行--------------------------------
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
animationDrawable.start();
}
Starts the animation, looping if necessary. This method has no effect if the animation is running. Do not call this in the onCreate(Bundle) method of your activity, because the AnimationDrawable is not yet fully attached to the window. If you want to play the animation immediately, without requiring interaction, then you might want to call it from the onWindowFocusChanged(boolean) method in your activity, which will get called when Android brings your window into focus.