小编Nam*_*ata的帖子

loader或AsyncTask有什么区别?

我想知道Android loader和AsyncTask之间的区别,这里是Loader的演示:

package com.android.loaderdemo;

import org.json.JSONArray;
import org.json.JSONObject;

import android.app.Activity;
import android.app.LoaderManager.LoaderCallbacks;
import android.content.AsyncTaskLoader;
import android.content.Context;
import android.content.Loader;
import android.os.Bundle;
import android.util.Log;
import android.view.Menu;
import android.widget.TextView;

import com.android.webprocessor.Http_GetServices;

public class MainActivity extends Activity implements LoaderCallbacks<String> {
    TextView txt_username, txt_userEmail, txt_password, txt_role, txt_secretQuestion, txt_answer, txt_zipcode;

    private static String url = "http://dotstg1.xyz.com/loud/webservcies/GetUserProfile.svc/GetUserProfile/124";
    static String response;
    static String name, email, Pasword, Answer, RoleId, SecretQuestion, Zip;

    static String useResult = null;

    static JSONArray userParams = null;

    private static final int THE_LOADER = 0x01;

    @Override …
Run Code Online (Sandbox Code Playgroud)

android loader android-asynctask

7
推荐指数
2
解决办法
8305
查看次数

UIautomator测试案例Android

我正在使用UiAutomator,但我无法使用UIAutomatorTestCase扩展我的类,我还添加了jar文件,即UIAutomator jar文件和JUnit3 lib.我在这个类中遇到错误而且我想知道如何为该应用程序构建测试用例以及如何以编程方式从我的应用程序运行测试用例?如果没有那么我怎么能运行这些测试用例.

  package com.example.test;

import junit.framework.TestCase;

public class UiAutomatorTestCase extends TestCase {

    private static final String DISABLE_IME = "disable_ime";
    private static final String DUMMY_IME_PACKAGE = "com.android.testing.dummyime";
    private UiDevice mUiDevice;
    private Bundle mParams;
    private IAutomationSupport mAutomationSupport;
    private boolean mShouldDisableIme = false;

    @Override
    protected void setUp() throws Exception {
        super.setUp();
        mShouldDisableIme = "true".equals(mParams.getString(DISABLE_IME));
        if (mShouldDisableIme) {
            setDummyIme();
        }
    }

    @Override
    protected void tearDown() throws Exception {
        if (mShouldDisableIme) {
            restoreActiveIme();
        }
        super.tearDown();
    }

    /**
     * Get current instance of {@link UiDevice}. …
Run Code Online (Sandbox Code Playgroud)

android junit3 android-uiautomator

5
推荐指数
1
解决办法
7809
查看次数

Android Canvas手指画

在我目前工作的一个项目上,我遇到了一些非常有害的问题

no good information available or
the good information is buried under a sea of bad information.
Run Code Online (Sandbox Code Playgroud)

我保留了这些问题,现在问题已经解决,我打算与所有开发人员分享一个简单的例子......

为了获得手指和绘画的触摸和动作事件, 我希望我的答案能帮助你们所有人......你可以根据自己的需要修改下面的内容..... :)

eclipse android canvas

2
推荐指数
1
解决办法
1295
查看次数

将字体添加到preferenceScreen标题

我已经创建了嵌套的preferenceScreens.I想要添加自定义字体,preferenceScreen title and summary.我尝试使用加载到字体的字体.我怎样才能做到这一点?谢谢.

这是我的preference.xml:

   <PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">
        <PreferenceCategory android:title="@string/manage_device_title" 
         android:key="@string/device_category">
             <PreferenceScreen android:title="@string/manage_device"
                 android:key="@string/manage_device_KEY"
                 android:summary="@string/device_summary" >     
             </PreferenceScreen>
        </PreferenceCategory>
   </PreferenceScreen>
Run Code Online (Sandbox Code Playgroud)

android preferencescreen typeface

2
推荐指数
1
解决办法
1246
查看次数