2013-02-01 12 views
0

我用下面的xml來設計我的android應用程序的佈局。我使用EditText字段獲取用戶的輸入。如何獲取使用Python的Android中的EditText中鍵入的文本?

<EditText android:layout_width="match_parent" 
    android:layout_height="wrap_content" 
    android:id="@+id/editText1" 
    android:tag="Tag Me" 
    android:inputType="text"> 
      <requestFocus></requestFocus> 
</EditText> 

如何獲得輸入該文本的文本並使用Python打印?

回答

0

你不能使用Python,Android編程是用Java完成的。您可以從EditText獲取文本如下(在Java中):

EditText et = (EditText)findViewById(R.id.editText1); 
String s = et.getText().toString(); 

如果你問如何文本發送到使用Python Web服務器,這是相當複雜一點。

+0

我實際上在開發android應用程序時使用了python。下面是我的編程指南鏈接:https://code.google.com/p/android-scripting/wiki/FullScreenUI – user2033209

相關問題