我收到一个FATAL EXCEPTION: AsyncTask #1
错误.
我没有创建异步任务我只是简单地调用下面的代码.
我从连接到网络的类中调用以下内容:
Toast.makeText(context, "Connection Successful", Toast.LENGTH_LONG).show();
Run Code Online (Sandbox Code Playgroud)
context
已经从构造函数中传递过了MainActivity
.
我不确定我在这里做错了什么.
我正在为Web应用程序提供移动支持.我的应用程序中有一个要求,即下拉屏幕刷新页面以获取最新更新.我在iPhone原生应用程序中看到了这个功能,它也在twitter和foursquare移动网站上实现.
我在这里看过一些帖子,但我无法理解他们到底在说什么......我对这个环境很新.请指导我做这个功能.
这个功能有没有javascript库或jqueries?
我正在开发一个Android应用程序,现在我限制用户只对所有活动使用水平视图.
我希望能够为用户提供旋转屏幕的选项,但是当我这样做时,活动从头开始而不是保持不变.
知道如何在旋转屏幕时保存状态吗?
我必须开发一个Android应用程序.我在这里得到以下错误:
03-26 21:29:00.394: E/AndroidRuntime(684): FATAL EXCEPTION: main
03-26 21:29:00.394: E/AndroidRuntime(684): java.lang.IndexOutOfBoundsException: Invalid index 1, size is 1
03-26 21:29:00.394: E/AndroidRuntime(684): at java.util.ArrayList.throwIndexOutOfBoundsException(ArrayList.java:257)
03-26 21:29:00.394: E/AndroidRuntime(684): at java.util.ArrayList.get(ArrayList.java:311)
03-26 21:29:00.394: E/AndroidRuntime(684): at com.xmlparsing.MainActivity.loadXMLData(MainActivity.java:303)
03-26 21:29:00.394: E/AndroidRuntime(684): at com.xmlparsing.MainActivity.access$2(MainActivity.java:118)
03-26 21:29:00.394: E/AndroidRuntime(684): at com.xmlparsing.MainActivity$GetXmlFiles.onPostExecute(MainActivity.java:369)
03-26 21:29:00.394: E/AndroidRuntime(684): at com.xmlparsing.MainActivity$GetXmlFiles.onPostExecute(MainActivity.java:1)
03-26 21:29:00.394: E/AndroidRuntime(684): at android.os.AsyncTask.finish(AsyncTask.java:417)
03-26 21:29:00.394: E/AndroidRuntime(684): at android.os.AsyncTask.access$300(AsyncTask.java:127)
03-26 21:29:00.394: E/AndroidRuntime(684): at android.os.AsyncTask$InternalHandler.handleMessage(AsyncTask.java:429)
03-26 21:29:00.394: E/AndroidRuntime(684): at android.os.Handler.dispatchMessage(Handler.java:99)
03-26 21:29:00.394: E/AndroidRuntime(684): at android.os.Looper.loop(Looper.java:123)
03-26 21:29:00.394: E/AndroidRuntime(684): at android.app.ActivityThread.main(ActivityThread.java:4627)
03-26 21:29:00.394: E/AndroidRuntime(684): …
Run Code Online (Sandbox Code Playgroud) 我创建了这个对象,它保存对其他一些对象的引用:
public class ListHandler {
private AppVariables app; //AppVariables instance
private Extra extra; //the extra argument represanting the list
private ArrayList<FacebookUser> arrayList; //the array list associate with the list given
private Comparator<FacebookUser> comparator; //the comparator of the list
private String emptyText; //list empty text
/**
* Constructor - initialize a new instance of the listHandler
* @param app the current {@link AppVariables} instance
* @param extra the {@link Extra} {@link Enum} of the list
*/
public ListHandler(AppVariables app, Extra extra) …
Run Code Online (Sandbox Code Playgroud) 我目前正在学习Java,并且是Android的新手.下面是我的onCreate方法,在它的最后我有两个EditText
字段,passT
(纯文本)和keyT
(加密密钥).我想将这两个作为参数传递给我的加密方法(也在下面)并检索结果并在密码中设置值EditText
.
我想将值设置为用户将输入的电子邮件地址(emailT
目前没有EditText
为其设置字段).
public class ScreenNext extends Activity {
int key = 0;
static char ch;
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_screen_next)
EditText emailT;//Import EditTexts (Key and Email)
Button send = (Button) findViewById(R.id.bSend);//Import button1 (Send)
final EditText passT = (EditText) findViewById(R.id.etTogg);//passT variable for Password Text for EditText field
final EditText keyT = (EditText) findViewById(R.id.etKey);
final EditText passT = (EditText) findViewById(R.id.etTogg);//passT variable for Password Text for EditText field
send.setOnClickListener(new …
Run Code Online (Sandbox Code Playgroud) 这是我的代码:
<TextView
android:id="@+id/timer"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="right"
android:layout_marginTop="50dp"
android:textColor="#873670" />
<TextView
android:id="@+id/questionList"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:textAppearance="?android:attr/textAppearanceLarge"
android:textColor="#110987" />
<RadioGroup
android:id="@+id/rgAns"
android:layout_width="wrap_content"
android:layout_height="wrap_content" >
<RadioButton
android:id="@+id/rbOpt1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:clickable="true"
android:onClick="usrAnsrChoice" />
<RadioButton
android:id="@+id/rbOpt2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:clickable="true"
android:onClick="usrAnsrChoice" />
<RadioButton
android:id="@+id/rbOpt3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:clickable="true"
android:onClick="usrAnsrChoice" />
</RadioGroup>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginRight="40dp"
android:orientation="horizontal" >
<Button
android:id="@+id/prevQstn"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/quizPrvBtnLbl" />
<Button
android:id="@+id/endTest"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/quizEndTstBtnLbl" />
<Button
android:id="@+id/nextQstn"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/quizNxtBtnLbl" />
<TextView
android:id="@+id/inc"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="right"
android:layout_marginTop="100dp"
android:textColor="#ffffff" />
</LinearLayout>
Run Code Online (Sandbox Code Playgroud)
我希望这个屏幕能够自动调整为4英寸,5英寸和2英寸屏幕.我还想完全支持mdpi和ldpi屏幕,并且在7英寸屏幕上看起来与在4英寸屏幕上看起来一样.我必须对XML进行哪些更改才能支持这些屏幕大小和密度?
现在我的布局在小屏幕上看起来很好,但在大屏幕上却没有那么多.此外,我不希望我的图像被拉伸或我的文本不对齐.
我想知道如何在c ++的构造函数中创建一个指向新创建对象的指针?
课程的地址是什么?
class MyClass
{
public:
};
class MyClass2
{
public:
//I need a pointer to the created object
MyClass2 *pObjectName;
//Constructor
MyClass2()
{
pObjectName = &//I have no clue how to get the adress of the (not yet) created object.
}
};
int main()
{
//The way it works
//Makes Object
MyClass *pObject;
MyClass Object;
//pObject points to Object
pObject = &Object;
//Prints adress of Object
printf("%p", pObject);
//The way I would like to see it work
MyClass2 …
Run Code Online (Sandbox Code Playgroud) 如何让我的Android滚动条看起来像这样?(见图片链接)....我正在开发我的第一个Android应用程序.我是Android的新手,有时最简单的事情可能是一个挑战.任何人都可以指出我正确的方向.谢谢.
如果我在Google Play中发布了免费应用程序,那么如何将此应用程序作为付费应用程序或添加应用程序内购买功能?
我在开发者文档中读到,
一旦您将应用程序发布为免费应用程序,您就无法将其更改为定价应用程序.不过,您仍然可以通过Google Play的应用内结算服务销售应用内商品和订阅.如果您将应用程序发布为定价应用程序,则可以随时将其更改为免费应用程序(但无法将其更改为定价).您还可以销售应用内商品和订阅.
android ×8
java ×3
arraylist ×1
asynchronous ×1
browser ×1
c++ ×1
constructor ×1
google-play ×1
html5 ×1
mobile ×1
object ×1
pointers ×1
rotation ×1
toast ×1