problem in Android Application

by rukesh » Fri, 19 Sep 2008 02:09:16 GMT


Sponsored Links
  m Rupesh Kumar.
I m trying to build a simple android application by sing eclips. The
java code for that project is as below

x.java

package x.y.z;

import x.y.z.R;
import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;


public class z extends Activity {
/** Called when the activity is first created. */

private EditText inputbox;
private TextView ans;
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setTheme(android.R.style.Theme_Dialog);
inputbox=(EditText)findViewById(R.id.editor);
inputbox.setText("");
ans=(TextView)findViewById(R.id.msg);
Button b = (Button)findViewById(R.id.b);

b.setOnClickListener(new Button.OnClickListener()
{
public void onClick(View v)
{
ans.setText("WelCome"+inputbox.getText());
inputbox.setText("");
}
});
setContentView(R.layout.main);
}

}



and
main. xml file is as below
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:paddingLeft="8px"
android:paddingRight="8px"
>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical">
<TextView android:id="@+id/msg"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="Enter Your Name:-"
/>
<EditText android:id="@+id/editor"
android:layout_width="fill_parent"
android:layout_height="50px"
android:capitalize="sentences"
android:layout_weight="1" >
<requestFocus />
</EditText>

<Button id="@+id/b"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="10"
android:layout_alignParentRight="false"
android:layout_marginLeft="100px"
android:text="Display" />
<ToggleButton
android:text="HelloRupesh"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<ImageButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/b"
android:layout_toLeftOf="@id/b"
android:layout_alignTop="@id/b"
android:src="@android:drawable/sym_action_call" />

<ImageView
android:src="@drawable/x"
android:adjustViewBounds="true"
android:maxWidth="30mm"
android:maxHeight="600mm"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<FrameLayout
android:layout_width="fill_parent"



problem in Android Application

by Megha Joshi » Fri, 19 Sep 2008 02:58:42 GMT


 id you check your logcat output? It will give you more details on the
error.
If you aren't able to resolve it from there, please post again with the
logcat output.

2008/9/18 rukesh <[EMAIL PROTECTED]>


--~--~---------~--~----~------------~-------~--~----~


Sponsored Links


Other Threads

1. listview (text+icon) inside a class Atcivity and not ListActivity

Hi

I want to know if its possible to make a listview (text+icon) on a
class extends Activity and not on a class extends ListActivity.

So I make a little code with class extends.

on the onCreate:

ListView list=(ListView) findViewById(R.id.list1);

ArrayList mStrings = new ArrayList();

ArrayAdapter mAdapter = new ArrayAdapter
(this,android.R.layout.simple_list_item_1, mStrings);

mAdapter.add("itemAdd ");
Log.v(TAG, mAdapter.getItem(0));
mAdapter.add("itemAdd1 ");
mAdapter.add("itemAdd2 ");
mAdapter.add("itemAdd3");
mAdapter.add("itemAdd4");
mAdapter.add("itemAdd5");
mAdapter.add("itemAdd6");
mAdapter.add("itemAdd7");
mAdapter.add("itemAdd8");
mAdapter.add("itemAdd9");

list.setAdapter(mAdapter);

so I find on the ApiDemos android the List14.java class using
EfficientAdapter class.

http://developer.android.com/intl/fr/guide/samples/ApiDemos/src/com/example/android/apis/view/List14.html

My question is, Can I just use class extends Activity to use the same
things like List14.java, with getView(int position, View convertView,
ViewGroup parent) ????

--~--~---------~--~----~------------~-------~--~----~

2. Will Animated GIF format be supported in Android Browser?

We understand that currently there is no Media Format support for
Animated GIF from the standard Android platform. Is there any roadmap
for that to be supported in Android Browser in the future?

Thanks

--~--~---------~--~----~------------~-------~--~----~

3. Federated app directories

4. Reasons for working in the platform instead of SDK

5. Samsung i7500 side lock button - why?

6. Reasons for working in the platform instead of SDK

7. How to send andio file to voice channel during call