Help with a simple Android UI

Put problem concerning Views, Layouts and other XML-Resources (like AndroidManifest) here.

Help with a simple Android UI

Postby neosephiroth86 » Sun Oct 25, 2009 11:11 am

hi!I need to create in Android a number of layouts for my input(every layout will be the input to manage the resource of a single process,and I will have a non finite number of them).the input layout code will be called recursively.I have a problem,the program crashes if I change the edittext field in a iteration superior to 1,I simplified my code to try to find the problem.
As you can see if a edit the edittext in the next layout (after I press the button) it shows me that input right,if I try to change it in my next iteration the program crashes.Can u help me?thanks

[syntax="java"]package com.test;

import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;
import java.util.Vector;

public class test extends Activity {

EditText quantita;

public void onCreate(Bundle savedInstanceState) {


public void inizio(){

Button button01 = (Button)findViewById(;
button01.setOnClickListener( new Button.OnClickListener(){
public void onClick(View view) {
quantita =(EditText)findViewById(;
int quantita1=Integer.parseInt(quantita.getText().toString());
TextView test=(TextView)findViewById(;
Button avanti = (Button)findViewById(;
avanti.setOnClickListener( new Button.OnClickListener(){
public void onClick(View view) {



[syntax="xml"]<AbsoluteLayout android:id="@+id/AbsoluteLayout01" android:layout_width="fill_parent" android:layout_height="fill_parent" xmlns:android=""><EditText android:layout_width="wrap_content" android:layout_height="wrap_content" android:id="@+id/EditText01" android:layout_y="156dip" android:layout_x="109dip" android:numeric="integer" android:text="0" android:editable="true" android:enabled="true"></EditText>
<Button android:layout_width="wrap_content" android:layout_height="wrap_content" android:id="@+id/Button01" android:layout_x="73dip" android:layout_y="282dip" android:text="avanti"></Button>

<AbsoluteLayout android:id="@+id/AbsoluteLayout01" android:layout_width="fill_parent" android:layout_height="fill_parent" xmlns:android=""><TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:id="@+id/TextView01" android:layout_y="124dip" android:layout_x="75dip"></TextView>
<Button android:layout_height="wrap_content" android:layout_width="wrap_content" android:layout_x="100dip" android:layout_y="65dip" android:text="avanti" android:id="@+id/avanti"></Button>
Posts: 4
Joined: Mon Sep 28, 2009 3:22 pm


Return to View, Layout & Resource Problems

Who is online

Users browsing this forum: No registered users and 2 guests