`
cyhcheng
  • 浏览: 57706 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论
文章列表
本方法基于Dialog,使用自定义布局,更能满足发杂的需求。 布局文件:dialog_must_enter.xml <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="ma ...
本方法在打开对话框后,如果没有选中项则禁用Positive Button,选中了选项后则使Positive Button可用. import android.app.Activity; import android.app.AlertDialog; import android.app.Dialog; import android.content.DialogInterface; import android.os.Bundle; import android.view.View; import android.view.View.OnClickListener; impor ...
本方法中,当点击Positive Button时,如果没有选择选项,则会以Toast的方式给出提示。 import android.app.Activity; import android.app.AlertDialog; import android.content.DialogInterface; import android.os.Bundle; import android.view.View; import android.view.View.OnClickListener; import android.widget.Button; import android.w ...
由于本人现在使用mac了,所以特别记录下mac下的几条命令: ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)" brew install wget brew install --universal --java subversion brew install mosquitto // mqtt协议的一种实现   ln -sfv /usr/local/opt/mosquitto/*.plist ~/Library/LaunchAgents 启动mqtt brok ...
在Android中使用Log时的处理:         Integer i = null;        try {            Log.v("abc == " + i.intValue());        } catch (Exception e) {            // 此处会引发新的异常:“java.lang.NullPointerException: println needs a message”,因为Android不支持消息内容为null.所以不能这样使用,需注意。            Log.e("MainActivity& ...

NDK入门

下载Android SDK、NDK,配置环境变量 新建一个android项目,在项目根目录下创建一个文件夹jni,创建Android.mk文件: LOCAL_PATH := $(call my-dir)include $(CLEAR_VARS)LOCAL_MODULE    := native-jniLOCAL_SRC_FILES := native.cLOCAL_LDLIBS    := -lloginclude $(BUILD_SHARED_LIBRARY)   创建Java代码: package com.example.simplendkdemo.util;publi ...
想在Android3.*+项目中使用Android2.*版的样式,删除values-v11和values-v142个文件夹下的styles.xml文件即可。 Android新版的样式: 旧版的样式:      
判断本地是否安装某个应用,如果没有安装,则打开google play store:     boolean isInstalledPrintShare(String packageName){        boolean installed = false;        if(TextUtils.isEmpty(packageName)){            return installed;        }        try {            getPackageManager().getPackageInfo(packageName, android.content ...
 Intent i = new Intent(); i.setAction(Intent.ACTION_VIEW);i.putExtra("key_text_input", "火车");i.putExtra("key_text_output", "");i.putExtra("key_language_from", "zh-CN");i.putExtra("key_language_to", "en");i.putExtra(" ...

读取Tag数据

import java.io.UnsupportedEncodingException;import android.app.Activity;import android.nfc.NdefMessage;import android.nfc.NfcAdapter;import android.os.Bundle;import android.os.Parcelable;import android.widget.TextView; public class MainActivity extends Activity {    NfcAdapter nfcAdapter;    TextVi ...

向Tag写入数据

 
授权:     <uses-permission android:name="android.permission.NFC" /> 在Activity中检测移动设备是否支持NFC         android.nfc.NfcAdapter nfcAdapter = NfcAdapter.getDefaultAdapter(this);        if (nfcAdapter == null); //This device doesn't support NFC! 检测移动设备是否打开NFC功能,如果没有打开,跳转到setting page ...
前几天项目组用到JBOSS7与EJB3,中间出了很多问题。写个demo记录下。太晚了具体看福建吧。如果JBOSS限制用户访问可以在EJB客户端做下面的配置: remote.connections=defaultendpoint.name=client-endpointremote.connection.default.port=4447remote.connection.default.host=localhostremote.connectionprovider.create.options.org.xnio.Options.SSL_ENABLED=falseremote.connect ...

urlrewriter的使用

    博客分类:
  • .Net
  由于目前接了个维护的项目,客户要求增加新功能,但新的访问格式类似于:http://www.domainName.com/aritcle/123这样的格式。同时本人对.Net也不熟悉,原来的项目使用的是Web Form,请教高人说使用MVC可能有些麻烦,所以不敢直接使用MVC3或MVC4。从网上找到可以使用urlrewriter.net。决定先写个Demo看下。 下载http://urlrewriter.net/index.php/download 用Visual Studio Manager打开下载的项目,编译后,从其Bin目录下拷贝Intelligencia.UrlRewriter ...

自己学习中碰到的问题

    博客分类:
  • C#
 
using System; using System.Linq; namespace StudyLinq {     class Program     {         public int Id { get; set; }         //public string Name { get; }//需要使用下面的方法替换本行代码,否则出现错误:'StudyLinq.Program.Name.get' must declare a body because it is not marked abstract or extern. Automatically implement ...
1.安装基础库: sudo apt-get install uuid 2. 登录数据库: sudo -u postgres psql databaseName 3. 安装扩展库: create extension "adminpack"; create extension "uuid-ossp";
Global site tag (gtag.js) - Google Analytics