资源简介

非常全面的demo , 保证能满足您的需求!包含广播 ,service , activity 的调用!

资源截图

代码片段和文件信息

package com.coder80.timer;

import com.coder80.timer.utils.ServiceUtil;

import android.support.v7.app.ActionBarActivity;
import android.content.Context;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;
/**
 * Created by coder80 on 2014/10/31.
 */
public class MainActivity extends ActionBarActivity implements View.onclickListener{
private TextView mTextView;
private Button mBtnStart;
private Button mBtnStop;
private Context mContext;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
mContext = this;
mTextView = (TextView) findViewById(R.id.show);
mBtnStart = (Button) findViewById(R.id.button1);
mBtnStop = (Button) findViewById(R.id.button2);
mBtnStart.setonclickListener(this);
mBtnStop.setonclickListener(this);
}

@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.main menu);
return true;
}

@Override
public boolean onOptionsItemSelected(MenuItem item) {
// Handle action bar item clicks here. The action bar will
// automatically handle clicks on the Home/Up button so long
// as you specify a parent activity in AndroidManifest.xml.
int id = item.getItemId();
if (id == R.id.action_settings) {
return true;
}
return super.onOptionsItemSelected(item);
}

@Override
public void onclick(View v) {
// TODO Auto-generated method stub
int id = v.getId();
switch(id){
case R.id.button1:
ServiceUtil.invokeTimerPOIService(mContext);
break;
case R.id.button2:
ServiceUtil.cancleAlarmManager(mContext);
break;
}

}
}

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2014-11-03 15:33  AlarmManagerTest\
     目录           0  2018-01-10 10:48  AlarmManagerTest\AlarmManager\
     文件        6148  2018-01-10 10:48  AlarmManagerTest\AlarmManager\.DS_Store
     文件         475  2014-10-31 23:55  AlarmManagerTest\AlarmManager\.classpath
     文件         852  2014-10-31 23:52  AlarmManagerTest\AlarmManager\.project
     目录           0  2014-11-03 15:33  AlarmManagerTest\AlarmManager\.settings\
     文件          57  2014-11-01 00:24  AlarmManagerTest\AlarmManager\.settings\org.eclipse.core.resources.prefs
     文件         177  2014-10-31 23:52  AlarmManagerTest\AlarmManager\.settings\org.eclipse.jdt.core.prefs
     文件        1493  2014-11-03 16:04  AlarmManagerTest\AlarmManager\AndroidManifest.xml
     目录           0  2014-11-03 17:09  AlarmManagerTest\AlarmManager\assets\
     目录           0  2014-11-03 15:33  AlarmManagerTest\AlarmManager\libs\
     文件      758727  2014-10-31 23:52  AlarmManagerTest\AlarmManager\libs\android-support-v4.jar
     文件         781  2014-10-31 23:52  AlarmManagerTest\AlarmManager\proguard-project.txt
     文件         607  2014-10-31 23:55  AlarmManagerTest\AlarmManager\project.properties
     目录           0  2014-11-03 15:33  AlarmManagerTest\AlarmManager\res\
     目录           0  2014-11-03 15:33  AlarmManagerTest\AlarmManager\res\drawable-hdpi\
     文件        7658  2014-10-31 23:52  AlarmManagerTest\AlarmManager\res\drawable-hdpi\ic_launcher.png
     目录           0  2014-11-03 17:09  AlarmManagerTest\AlarmManager\res\drawable-ldpi\
     目录           0  2014-11-03 15:33  AlarmManagerTest\AlarmManager\res\drawable-mdpi\
     文件        3777  2014-10-31 23:52  AlarmManagerTest\AlarmManager\res\drawable-mdpi\ic_launcher.png
     目录           0  2014-11-03 15:33  AlarmManagerTest\AlarmManager\res\drawable-xhdpi\
     文件       12516  2014-10-31 23:52  AlarmManagerTest\AlarmManager\res\drawable-xhdpi\ic_launcher.png
     目录           0  2014-11-03 15:33  AlarmManagerTest\AlarmManager\res\drawable-xxhdpi\
     文件       24777  2014-10-31 23:52  AlarmManagerTest\AlarmManager\res\drawable-xxhdpi\ic_launcher.png
     目录           0  2014-11-03 15:33  AlarmManagerTest\AlarmManager\res\layout\
     文件        1657  2014-11-01 00:00  AlarmManagerTest\AlarmManager\res\layout\activity_main.xml
     目录           0  2014-11-03 15:33  AlarmManagerTest\AlarmManager\res\menu\
     文件         420  2014-10-31 23:52  AlarmManagerTest\AlarmManager\res\menu\main.xml
     目录           0  2014-11-03 15:33  AlarmManagerTest\AlarmManager\res\values\
     目录           0  2014-11-03 15:33  AlarmManagerTest\AlarmManager\res\values-v11\
     文件         331  2014-10-31 23:52  AlarmManagerTest\AlarmManager\res\values-v11\styles.xml
............此处省略538个文件信息

评论

共有 条评论