Skip to content

Instantly share code, notes, and snippets.

@bng86
bng86 / gist:7635158
Last active December 29, 2015 07:19
<script>
checkUser = function (){
var user = $("#user").val();
$.ajax({
url: 'checkAjax.php',
// cache: false,
dataType: 'html',
type:'GET',
data: {
user : user,
private String mAccount, mPassword;
private Account account = new Account();
private AccountPaser accountPaser = new AccountPaser();
private String json = null;
private AsyncTaskCallBack mCallBack;
public HttpTaskUIDLogin(Context context, String account, String password,
AsyncTaskCallBack callBack) {
// mContext = context;
mPassword = password;
package com.example.test;
import android.app.Activity;
import android.content.Context;
import android.os.Bundle;
public abstract class BaseActivity extends Activity{
Context CONTEXT;
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android" >
<item>
<shape android:shape="rectangle" >
<solid android:color="#FFF" />
<stroke
android:width="1dp"
android:color="#ccc" />
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android" >
<item>
<shape android:shape="rectangle" >
<solid android:color="#FFF" />
<stroke
android:width="1dp"
android:color="#ccc" />
WindowManager.LayoutParams params = getWindow().getAttributes();
if (params.softInputMode == WindowManager.LayoutParams.SOFT_INPUT_STATE_VISIBLE) {
//鍵盤顯示狀態
}else{
//鍵盤隱藏狀態
}
@bng86
bng86 / activity_my.xml
Created July 14, 2014 03:06
activity_my.xml
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:padding="16dp"
tools:context=".MyActivity">
<ListView
package tw.andyang.listviewwithbaseadapter;
import android.app.Activity;
import android.os.Bundle;
import android.widget.ListView;
public class MyActivity extends Activity {
private ListView listView;
private MyAdapter adapter;
package tw.andyang.listviewwithbaseadapter;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.TextView;
public class MyAdapter extends BaseAdapter {
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:padding="8dp">
<TextView
android:id="@+id/title"
android:paddingBottom="8dp"