安卓透明桌面倒计时透明版插件 麻烦发发给我 谢谢...

能帮我发一个稀有物品刷新倒计时插件吗?我找不到,谢谢你了。QQ _百度知道谁有安卓透明倒计时插件啊?给我发一个吧。_百度知道13970人阅读
Android(36)
&DigitalClock
android:id=&@+id/myClock&
android:layout_width=&wrap_content&
android:layout_height=&wrap_content&
android:layout_alignParentTop=&true&
android:layout_centerHorizontal=&true&
android:layout_margin=&10dp&
android:textSize=&30sp& /&
android:id=&@+id/text_select&
android:layout_width=&wrap_content&
android:layout_height=&wrap_content&
android:layout_below=&@id/myClock&
android:layout_centerHorizontal=&true&
android:text=&@string/text_select&
android:textSize=&20sp& /&
&EditText android:id=&@+id/minute&
android:layout_width=&60dp&
android:layout_height=&80dp&
android:layout_below=&@id/text_select&
android:layout_alignLeft=&@id/myClock&
android:layout_marginTop=&20dp&
android:inputType=&number&
android:gravity=¢er&
&EditText android:id=&@+id/second&
android:layout_width=&60dp&
android:layout_height=&80dp&
android:layout_below=&@id/text_select&
android:layout_toRightOf=&@id/minute&
android:layout_marginTop=&20dp&
android:inputType=&number&
android:gravity=¢er&
android:id=&@+id/button_start&
android:layout_width=&match_parent&
android:layout_height=&wrap_content&
android:layout_alignParentBottom=&true&
android:gravity=¢er&
android:padding=&10dp&
android:text=&@string/myButtonText&
android:textSize=&30sp& /&
&TextView android:id=&@+id/myTime&
android:layout_width=&fill_parent&
android:layout_height=&fill_parent&
android:layout_margin=&30dp&
android:textSize=&100sp&
android:textColor=&#FF0000&
android:gravity=¢er&
android:textStyle=&bold& /&
MainActivity.java
public class MainActivity extends Activity {
Button startB
EditText minuteT
EditText secondT
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
requestWindowFeature(Window.FEATURE_NO_TITLE);
setContentView(R.layout.main);
startButton = (Button) findViewById(R.id.button_start);
minuteText = (EditText)findViewById(R.id.minute);
secondText = (EditText)findViewById(R.id.second);
startButton.setOnClickListener(new OnClickListener() {
public void onClick(View v) {
if (!minuteText.getText().toString().equals(&&)) {
minute = Integer.parseInt(minuteText.getText().toString());
if (!secondText.getText().toString().equals(&&)) {
second = Integer.parseInt(secondText.getText().toString());
if (minute != 0 || second != 0) {
System.out.println(minute+&:&+second);
ArrayList&Integer& list = new ArrayList&Integer&();
list.add(minute);
list.add(second);
Intent intent = new Intent();
intent.setAction(&com.example.mytime.StartActivity&);
intent.putIntegerArrayListExtra(×&, list);
startActivity(intent);
protected void onResume() {
// TODO Auto-generated method stub
minute = 0;
second = 0;
super.onResume();
StartActivity.java
public class StartActivity extends Activity{
static int minute = -1;
static int second = -1;
final static String tag = &tag&;
TextView timeV
Handler handler = new Handler(){
public void handleMessage(Message msg) {
System.out.println(&handle!&);
if (minute == 0) {
if (second == 0) {
timeView.setText(&Time out !&);
if (timer != null) {
timer.cancel();
if (timerTask != null) {
timerTask =
if (second &= 10) {
timeView.setText(&0&+minute + &:& + second);
timeView.setText(&0&+minute + &:0& + second);
if (second == 0) {
second =59;
if (minute &= 10) {
timeView.setText(minute + &:& + second);
timeView.setText(&0&+minute + &:& + second);
if (second &= 10) {
if (minute &= 10) {
timeView.setText(minute + &:& + second);
timeView.setText(&0&+minute + &:& + second);
if (minute &= 10) {
timeView.setText(minute + &:0& + second);
timeView.setText(&0&+minute + &:0& + second);
protected void onCreate(Bundle savedInstanceState) {
Log.v(tag, &log----------&onCreate!&);
requestWindowFeature(Window.FEATURE_NO_TITLE);
super.onCreate(savedInstanceState);
setContentView(R.layout.start);
timeView = (TextView)findViewById(R.id.myTime);
if (minute == -1 && second == -1) {
Intent intent = getIntent();
ArrayList&Integer& times = intent.getIntegerArrayListExtra(×&);
minute = times.get(0);
second = times.get(1);
timeView.setText(minute + &:& + second);
timerTask = new TimerTask() {
public void run() {
Message msg = new Message();
msg.what = 0;
handler.sendMessage(msg);
timer = new Timer();
timer.schedule(timerTask,0,1000);
protected void onDestroy() {
Log.v(tag, &log----------&onDestroy!&);
if (timer != null) {
timer.cancel();
if (timerTask != null) {
timerTask =
minute = -1;
second = -1;
super.onDestroy();
protected void onStart() {
Log.v(tag, &log----------&onStart!&);
super.onStart();
protected void onStop() {
Log.v(tag, &log----------&onStop!&);
super.onStop();
protected void onResume() {
Log.v(tag, &log----------&onResume!&);
super.onResume();
protected void onRestart() {
Log.v(tag, &log----------&onRestart!&);
super.onRestart();
protected void onPause() {
Log.v(tag, &log----------&onPause!&);
super.onPause();
参考知识库
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
访问:357664次
积分:5303
积分:5303
排名:第3491名
原创:128篇
评论:284条
技术交流:
微信:chrp99
阅读:69072
文章:29篇
阅读:93587
文章:11篇
阅读:43388
(1)(5)(29)(18)(15)(5)(2)(2)(6)(20)(5)(15)(1)(1)(3)

参考资料

 

随机推荐