`
liangoogle
  • 浏览: 273647 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论
文章列表
Java代码 private long exitTime = 0;      @Override    public boolean onKeyDown(int keyCode, KeyEvent event) {       if(keyCode == KeyEvent.KEYCODE_BACK && event.getAction() == KeyEvent.ACTION_DOWN){                         if((System.currentTimeMillis ...
本文时在activity中创建桌面快捷方式:     public void onCreate(Bundle savedInstanceState) {         super.onCreate(savedInstanceState);         setContentView(R.layout.main);         if(!IfaddShortCut())             createShortCut();         else             Toast.makeText(this, "已经创建", Toast.LEN ...
根据图片名字  读取图片   int id_up = context.getResources().getIdentifier(pic,                     "drawable", "com.wiwigo.app");   取得的是图片的id
这个就和显示dialog一样的道理,都要使用父类显示: 解决方法如下: 1  这是这个activity要显示的 view  R.layout.localview中有spinner 控件 View contentView = LayoutInflater.from(this.getParent()).inflate(R.layout.localview,null);   setContentView(contentView);
rm -fr myapp myapp为文件夹名
如果没设置root密码可以使用 sudo passwd root设置密码 然后切换到root使用 su root 如果不想切换root但是想拥有大部分root权限 可以在使用命令时候 加上 sudo, sudo mount 挂载 sudo 命令

linux 安装emacs

  第一种:只安装的是默认版本 sudo apt-get install erlang 第二种: 1 获得一个最新 erlang源代码,代码在一个文件之中,他的名字类似otp_src_R11B-4.tar.gz 2 按照下面的步骤进行解包,配置,编译,以及安装: $ tar -xzf otp_src_R11B-4.tar.gz $ cd otp_src_R11B-4 $ ./configure $ make $ sudo make install    
在home/blue新建文件夹:erl 1: 此时可以编译这个文件夹下的文件了。 首先:输入 ~$erl cd("/home/blue/erl"). c(demo).   2: ~$cd /home/blue/erl $erl c(demo).

erlang 安装使用

1、修改其安装源文件 > sudo gedit /etc/apt/sources.list   找到'partner' repository,如下: ## Uncomment the following two lines to add software from Canonical's   ## 'partner' repository.   ## This software is not part of Ubuntu, but is offered by Canonical and the   ## respective vendors as a servic ...
分享时,打开发送蓝牙文件中的链接:    Intent intent=new Intent(Intent.ACTION_SEND);                     intent.setType("text/plain");  //分享的数据类型                   intent.putExtra(Intent.EXTRA_SUBJECT,getString(R.string.send_subject));  //主题                   String url1= "http://www.yybackup.co ...
  \b \b \b \b 要分开写,写一个一个空格,这样才能在手机显示出来。

获取控件坐标

 
int[] location = new  location[2] ;view.getLocationInWindow(location); //获取在当前窗口内的绝对坐标view.getLocationOnScreen(location);//获取在整个屏幕内的绝对坐标location [0]--->x坐标,location [1]--->y坐标
 public static void showInstalledAppDetails(Context context, String packageName) {           Intent intent = new Intent();           final int apiLevel = Build.VERSION.SDK_INT;           if (apiLevel >= 9) { // 2.3(ApiLevel 9)以上,使用SDK提供的接口               intent.setAction("android.settin ...
安装 apk:                                         Intent i = new Intent(Intent.ACTION_VIEW);                                         String filePath = appInfo.getAbsolutePath();                                         i.setDataAndType(Uri.parse("file://" + filePath),                   ...
在android系统中,安装和卸载都会发送广播,当应用安装完成后系统会发android.intent.action.PACKAGE_ADDED广播。可以通过intent.getDataString()获得所安装的包名。当卸载程序时系统发android.intent.action.PACKAGE_REMOVED广播。同样intent.getDataString()获得所卸载的包名。应用程序无法监听自己的安装与卸载,但覆盖安装可以监听到自己的android.intent.action.PACKAGE_REMOVED广播。     public class Pa ...
Global site tag (gtag.js) - Google Analytics