我已经从我的手册和互联网上阅读了许多解释getView方法的教程,但我不明白为什么他们使用它.有人可以用一些例子或片段向我解释一下吗?
我在活动中遇到一个问题:我想读取Ordinazioni.txt前一个活动中正确编写的所有文件,将它们放入一个并将其中的ArrayList每个元素写入MySQL数据库.
现在,PHP文件和文件是正确的,我已经单独检查了它们的工作,但此时LogCat阻止了应用程序.所以,在这里你是活动和LogCat.
public class AggiungiProdotto extends Activity {
TextView tv1;
private static String indirizzo ="http://10.0.2.2/tesina/Aggiungi_Ordinazione";
FileInputStream in = null;
InputStreamReader inputStreamReader = new InputStreamReader(in);
BufferedReader bufferedReader = new BufferedReader(inputStreamReader);
HttpClient httpclient = new DefaultHttpClient();
HttpPost httppost = new HttpPost(indirizzo);
StringBuilder sb = new StringBuilder();
int Tavolo = 1;
String line;
public ArrayList<String> Lettura = new ArrayList<String>();
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.aggiungi_prodotto);
Invio();
}
public void Invio() {
try {
FileInputStream in = openFileInput("Ordinazioni.txt"); …Run Code Online (Sandbox Code Playgroud)