[Q] My aplication is shuting down by no reason - Java for Android App Development

Hello ! I left my eclipse for a few days, after that my aplicaton for no reason is working bad. First Activity is opening as well, but aplication is closing when first activity is opening second. I was searching mistakes or errors in code but i have nothing. Below i paste code of first activity and second. Please help.
First Activity:
Code:
public class Pierwsza extends ActionBarActivity{
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.pierwszy);
getSupportActionBar().hide();
Thread welcomeThread = new Thread()
{
@Override
public void run() {
try {
super.run();
sleep(3000) ; //Delay of 10 seconds
} catch (Exception e) {
} finally {
Intent i = new Intent(Pierwsza.this,
MainActivity.class);
startActivity(i);
finish();
}
}
};
welcomeThread.start();
}
}
second:
Code:
public class MainActivity extends ActionBarActivity {
ArrayAdapter<String> dataAdapter = null;
ArrayList<String> elementy = new ArrayList<String>();
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
getSupportActionBar().hide();
ListaPiosenek();
powiadomienie();
}
private void ListaPiosenek() {
ArrayList<String> elementy = new ArrayList<String>();
elementy.add("Dom w górach");
elementy.add("Jedyne co mam");
elementy.add("Koncert");
elementy.add("Ocean");
elementy.add("Tolerancja");
elementy.add("Wiesiek idzie");
elementy.add("Wiosna, ach to ty");
elementy.add("Chłopaki nie płaczą");
elementy.add("Dziki Włóczęga");
elementy.add("Imperatyw");
elementy.add("Piosenka Turystyczna III");
elementy.add("Remedium");
elementy.add("Kiedy będę starą kobietą");
elementy.add("Długość dźwięku samotności");
elementy.add("Król");
elementy.add("Anna");
elementy.add("Syn Miasta");
elementy.add("Samotna fregata");
elementy.add("Balonik");
elementy.add("Partyzant");
elementy.add("O mój rozmarynie");
elementy.add("Sosenka");;
// elementy.add("Długość dźwięku samotności");
// elementy.add("Długość dźwięku samotności");
// elementy.add("Długość dźwięku samotności");
// elementy.add("Długość dźwięku samotności");
// elementy.add("Długość dźwięku samotności");
Collections.sort(elementy);
final ArrayAdapter<String> dataAdapter = new ArrayAdapter<String>(this,R.layout.single_row,elementy);
final ListView list=(ListView)findViewById(R.id.listView1);
list.setAdapter(dataAdapter);
list.setFocusableInTouchMode(true);
list.requestFocus();
list.setTextFilterEnabled(true);
EditText myFilter =(EditText)findViewById(R.id.editText1);
myFilter.addTextChangedListener(new TextWatcher(){
@Override
public void beforeTextChanged(CharSequence s, int start, int count,
int after) {
// TODO Auto-generated method stub
}
@Override
public void onTextChanged(CharSequence s, int start, int before,
int count) {
dataAdapter.getFilter().filter(s.toString());
}
@Override
public void afterTextChanged(Editable s) {
// TODO Auto-generated method stub
}
});
}
private void powiadomienie() {
ListView list = (ListView)findViewById(R.id.listView1);
list.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> parent, View viewClicked,
int position, long id) {
String sText = ((TextView) viewClicked).getText().toString();
if(sText.equals("Dom w górach")){
Intent i = new Intent(MainActivity.this,Utwor0.class);
startActivity(i);
overridePendingTransition(R.animator.animation1, R.animator.animation2);
}
else if(sText.equals("Jedyne co mam")){
Intent i = new Intent(MainActivity.this, Utwor1.class);
startActivity(i);
}
else if(sText.equals("Koncert")){
Intent i = new Intent(MainActivity.this, Utwor2.class);
startActivity(i);
}
else if(sText.equals("Ocean")){
Intent i = new Intent(MainActivity.this, Utwor3.class);
startActivity(i);
}
else if(sText.equals("Tolerancja")){
Intent i = new Intent(MainActivity.this, Utwor4.class);
startActivity(i);
}
else if (sText.equals("Wiesiek idzie")){
Intent i = new Intent(MainActivity.this, Utwor5.class);
startActivity(i);
}
else if(sText.equals("Wiosna, ach to ty")){
Intent i = new Intent(MainActivity.this, Utwor6.class);
startActivity(i);
}
else if(sText.equals("Chłopaki nie płaczą")){
Intent i = new Intent(MainActivity.this, Utwor7.class);
startActivity(i);
}
else if(sText.equals("Dziki Włóczęga")){
Intent i = new Intent(MainActivity.this, Utwor8.class);
startActivity(i);
}
else if(sText.equals("Imperatyw")){
Intent i = new Intent(MainActivity.this, Utwor9.class);
startActivity(i);
}
else if(sText.equals("Piosenka Turystyczna III")){
Intent i = new Intent(MainActivity.this, Utwor10.class);
startActivity(i);
}
else if(sText.equals("Remedium")){
Intent i = new Intent(MainActivity.this, Utwor11.class);
startActivity(i);
}
else if(sText.equals("Kiedy będę starą kobietą")){
Intent i = new Intent(MainActivity.this, Utwor12.class);
startActivity(i);
}
else if(sText.equals("Długość dźwięku samotności")){
Intent i = new Intent(MainActivity.this, Utwor13.class);
startActivity(i);
}
else if(sText.equals("Król")){
Intent i = new Intent(MainActivity.this, Utwor14.class);
startActivity(i);
}
else if(sText.equals("Anna")){
Intent i = new Intent(MainActivity.this, Utwor15.class);
startActivity(i);
}
else if(sText.equals("Syn Miasta")){
Intent i = new Intent(MainActivity.this, Utwor16.class);
startActivity(i);
}
else if(sText.equals("Samotna fregata")){
Intent i = new Intent(MainActivity.this, Utwor17.class);
startActivity(i);
}
else if(sText.equals("Balonik")){
Intent i = new Intent(MainActivity.this, Utwor18.class);
startActivity(i);
}
else if(sText.equals("Partyzant")){
Intent i = new Intent(MainActivity.this, Utwor19.class);
startActivity(i);
}
else if(sText.equals("O mój rozmarynie")){
Intent i = new Intent(MainActivity.this, Utwor20.class);
startActivity(i);
}
else if(sText.equals("Sosenka")){
Intent i = new Intent(MainActivity.this, Utwor21.class);
startActivity(i);
}
}
});
}
}
Eclipse is not showing red errors in code.

Matma said:
Hello ! I left my eclipse for a few days, after that my aplicaton for no reason is working bad. First Activity is opening as well, but aplication is closing when first activity is opening second. I was searching mistakes or errors in code but i have nothing. Below i paste code of first activity and second. Please help.
First Activity:
Code:
public class Pierwsza extends ActionBarActivity{
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.pierwszy);
getSupportActionBar().hide();
Thread welcomeThread = new Thread()
{
@Override
public void run() {
try {
super.run();
sleep(3000) ; //Delay of 10 seconds
} catch (Exception e) {
} finally {
Intent i = new Intent(Pierwsza.this,
MainActivity.class);
startActivity(i);
finish();
}
}
};
welcomeThread.start();
}
}
second:
Code:
public class MainActivity extends ActionBarActivity {
ArrayAdapter<String> dataAdapter = null;
ArrayList<String> elementy = new ArrayList<String>();
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
getSupportActionBar().hide();
ListaPiosenek();
powiadomienie();
}
private void ListaPiosenek() {
ArrayList<String> elementy = new ArrayList<String>();
elementy.add("Dom w górach");
elementy.add("Jedyne co mam");
elementy.add("Koncert");
elementy.add("Ocean");
elementy.add("Tolerancja");
elementy.add("Wiesiek idzie");
elementy.add("Wiosna, ach to ty");
elementy.add("Chłopaki nie płaczą");
elementy.add("Dziki Włóczęga");
elementy.add("Imperatyw");
elementy.add("Piosenka Turystyczna III");
elementy.add("Remedium");
elementy.add("Kiedy będę starą kobietą");
elementy.add("Długość dźwięku samotności");
elementy.add("Król");
elementy.add("Anna");
elementy.add("Syn Miasta");
elementy.add("Samotna fregata");
elementy.add("Balonik");
elementy.add("Partyzant");
elementy.add("O mój rozmarynie");
elementy.add("Sosenka");;
//elementy.add("Długość dźwięku samotności");
//elementy.add("Długość dźwięku samotności");
//elementy.add("Długość dźwięku samotności");
//elementy.add("Długość dźwięku samotności");
//elementy.add("Długość dźwięku samotności");
Collections.sort(elementy);
final ArrayAdapter<String> dataAdapter = new ArrayAdapter<String>(this,R.layout.single_row,elementy);
final ListView list=(ListView)findViewById(R.id.listView1);
list.setAdapter(dataAdapter);
list.setFocusableInTouchMode(true);
list.requestFocus();
list.setTextFilterEnabled(true);
EditText myFilter =(EditText)findViewById(R.id.editText1);
myFilter.addTextChangedListener(new TextWatcher(){
@Override
public void beforeTextChanged(CharSequence s, int start, int count,
int after) {
// TODO Auto-generated method stub
}
@Override
public void onTextChanged(CharSequence s, int start, int before,
int count) {
dataAdapter.getFilter().filter(s.toString());
}
@Override
public void afterTextChanged(Editable s) {
// TODO Auto-generated method stub
}
});
}
private void powiadomienie() {
ListView list = (ListView)findViewById(R.id.listView1);
list.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> parent, View viewClicked,
int position, long id) {
String sText = ((TextView) viewClicked).getText().toString();
if(sText.equals("Dom w górach")){
Intent i = new Intent(MainActivity.this,Utwor0.class);
startActivity(i);
overridePendingTransition(R.animator.animation1, R.animator.animation2);
}
else if(sText.equals("Jedyne co mam")){
Intent i = new Intent(MainActivity.this, Utwor1.class);
startActivity(i);
}
else if(sText.equals("Koncert")){
Intent i = new Intent(MainActivity.this, Utwor2.class);
startActivity(i);
}
else if(sText.equals("Ocean")){
Intent i = new Intent(MainActivity.this, Utwor3.class);
startActivity(i);
}
else if(sText.equals("Tolerancja")){
Intent i = new Intent(MainActivity.this, Utwor4.class);
startActivity(i);
}
else if (sText.equals("Wiesiek idzie")){
Intent i = new Intent(MainActivity.this, Utwor5.class);
startActivity(i);
}
else if(sText.equals("Wiosna, ach to ty")){
Intent i = new Intent(MainActivity.this, Utwor6.class);
startActivity(i);
}
else if(sText.equals("Chłopaki nie płaczą")){
Intent i = new Intent(MainActivity.this, Utwor7.class);
startActivity(i);
}
else if(sText.equals("Dziki Włóczęga")){
Intent i = new Intent(MainActivity.this, Utwor8.class);
startActivity(i);
}
else if(sText.equals("Imperatyw")){
Intent i = new Intent(MainActivity.this, Utwor9.class);
startActivity(i);
}
else if(sText.equals("Piosenka Turystyczna III")){
Intent i = new Intent(MainActivity.this, Utwor10.class);
startActivity(i);
}
else if(sText.equals("Remedium")){
Intent i = new Intent(MainActivity.this, Utwor11.class);
startActivity(i);
}
else if(sText.equals("Kiedy będę starą kobietą")){
Intent i = new Intent(MainActivity.this, Utwor12.class);
startActivity(i);
}
else if(sText.equals("Długość dźwięku samotności")){
Intent i = new Intent(MainActivity.this, Utwor13.class);
startActivity(i);
}
else if(sText.equals("Król")){
Intent i = new Intent(MainActivity.this, Utwor14.class);
startActivity(i);
}
else if(sText.equals("Anna")){
Intent i = new Intent(MainActivity.this, Utwor15.class);
startActivity(i);
}
else if(sText.equals("Syn Miasta")){
Intent i = new Intent(MainActivity.this, Utwor16.class);
startActivity(i);
}
else if(sText.equals("Samotna fregata")){
Intent i = new Intent(MainActivity.this, Utwor17.class);
startActivity(i);
}
else if(sText.equals("Balonik")){
Intent i = new Intent(MainActivity.this, Utwor18.class);
startActivity(i);
}
else if(sText.equals("Partyzant")){
Intent i = new Intent(MainActivity.this, Utwor19.class);
startActivity(i);
}
else if(sText.equals("O mój rozmarynie")){
Intent i = new Intent(MainActivity.this, Utwor20.class);
startActivity(i);
}
else if(sText.equals("Sosenka")){
Intent i = new Intent(MainActivity.this, Utwor21.class);
startActivity(i);
}
}
});
}
}
Eclipse is not showing red errors in code.
Click to expand...
Click to collapse
Is log showing something?
Gesendet von meinem LG-D855 mit Tapatalk

FATAL EXCEPTION: main
java.lang.OutOfMemoryError
E/AndroidRuntime(882): at android.graphics.BitmapFactory.nativeDecodeAsset(Native Method)
E/AndroidRuntime(882): at android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:502)
E/AndroidRuntime(882): at android.graphics.BitmapFactory.decodeResourceStream(BitmapFactory.java:355)
E/AndroidRuntime(882): at android.graphics.drawable.Drawable.createFromResourceStream(Drawable.java:785)
E/AndroidRuntime(882): at android.content.res.Resources.loadDrawable(Resources.java:1965)
E/AndroidRuntime(882): at android.content.res.TypedArray.getDrawable(TypedArray.java:601)
E/AndroidRuntime(882): at android.view.View.<init>(View.java:3330)
E/AndroidRuntime(882): at android.widget.TextView.<init>(TextView.java:583)
E/AndroidRuntime(882): at android.widget.EditText.<init>(EditText.java:60)
E/AndroidRuntime(882): at android.support.v7.internal.widget.TintEditText.<init>(TintEditText.java:44)
E/AndroidRuntime(882): at android.support.v7.internal.widget.TintEditText.<init>(TintEditText.java:40)
E/AndroidRuntime(882): at android.support.v7.app.ActionBarActivityDelegateBase.createView(ActionBarActivityDelegateBase.java:759)
E/AndroidRuntime(882): at android.support.v7.app.ActionBarActivity.onCreateView(ActionBarActivity.java:552)
E/AndroidRuntime(882): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:676)
E/AndroidRuntime(882): at android.view.LayoutInflater.rInflate(LayoutInflater.java:746)
E/AndroidRuntime(882): at android.view.LayoutInflater.inflate(LayoutInflater.java:489)
E/AndroidRuntime(882): at android.view.LayoutInflater.inflate(LayoutInflater.java:396)
E/AndroidRuntime(882): at android.view.LayoutInflater.inflate(LayoutInflater.java:352)
at android.support.v7.app.ActionBarActivity.setContentView(ActionBarActivity.java:102)
at com.example.another.MainActivity.onCreate(MainActivity.java:29)
at android.app.Activity.performCreate(Activity.java:5104)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1080)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2144)
E/AndroidRuntime(882): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2230)
E/AndroidRuntime(882): at android.app.ActivityThread.access$600(ActivityThread.java:141)
E/AndroidRuntime(882): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1234)
E/AndroidRuntime(882): at android.os.Handler.dispatchMessage(Handler.java:99)
E/AndroidRuntime(882): at android.os.Looper.loop(Looper.java:137)
E/AndroidRuntime(882): at android.app.ActivityThread.main(ActivityThread.java:5041)
E/AndroidRuntime(882): at java.lang.reflect.Method.invokeNative(Native Method)
E/AndroidRuntime(882): at java.lang.reflect.Method.invoke(Method.java:511)
E/AndroidRuntime(882): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
E/AndroidRuntime(882): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)
E/AndroidRuntime(882): at dalvik.system.NativeStart.main(Native Method)

Matma said:
FATAL EXCEPTION: main
java.lang.OutOfMemoryError
E/AndroidRuntime(882): at android.graphics.BitmapFactory.nativeDecodeAsset(Native Method)
E/AndroidRuntime(882): at android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:502)
E/AndroidRuntime(882): at android.graphics.BitmapFactory.decodeResourceStream(BitmapFactory.java:355)
E/AndroidRuntime(882): at android.graphics.drawable.Drawable.createFromResourceStream(Drawable.java:785)
E/AndroidRuntime(882): at android.content.res.Resources.loadDrawable(Resources.java:1965)
E/AndroidRuntime(882): at android.content.res.TypedArray.getDrawable(TypedArray.java:601)
E/AndroidRuntime(882): at android.view.View.(View.java:3330)
E/AndroidRuntime(882): at android.widget.TextView.(TextView.java:583)
E/AndroidRuntime(882): at android.widget.EditText.(EditText.java:60)
E/AndroidRuntime(882): at android.support.v7.internal.widget.TintEditText.(TintEditText.java:44)
E/AndroidRuntime(882): at android.support.v7.internal.widget.TintEditText.(TintEditText.java:40)
E/AndroidRuntime(882): at android.support.v7.app.ActionBarActivityDelegateBase.createView(ActionBarActivityDelegateBase.java:759)
E/AndroidRuntime(882): at android.support.v7.app.ActionBarActivity.onCreateView(ActionBarActivity.java:552)
E/AndroidRuntime(882): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:676)
E/AndroidRuntime(882): at android.view.LayoutInflater.rInflate(LayoutInflater.java:746)
E/AndroidRuntime(882): at android.view.LayoutInflater.inflate(LayoutInflater.java:489)
E/AndroidRuntime(882): at android.view.LayoutInflater.inflate(LayoutInflater.java:396)
E/AndroidRuntime(882): at android.view.LayoutInflater.inflate(LayoutInflater.java:352)
at android.support.v7.app.ActionBarActivity.setContentView(ActionBarActivity.java:102)
at com.example.another.MainActivity.onCreate(MainActivity.java:29)
at android.app.Activity.performCreate(Activity.java:5104)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1080)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2144)
E/AndroidRuntime(882): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2230)
E/AndroidRuntime(882): at android.app.ActivityThread.access$600(ActivityThread.java:141)
E/AndroidRuntime(882): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1234)
E/AndroidRuntime(882): at android.os.Handler.dispatchMessage(Handler.java:99)
E/AndroidRuntime(882): at android.os.Looper.loop(Looper.java:137)
E/AndroidRuntime(882): at android.app.ActivityThread.main(ActivityThread.java:5041)
E/AndroidRuntime(882): at java.lang.reflect.Method.invokeNative(Native Method)
E/AndroidRuntime(882): at java.lang.reflect.Method.invoke(Method.java:511)
E/AndroidRuntime(882): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
E/AndroidRuntime(882): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)
E/AndroidRuntime(882): at dalvik.system.NativeStart.main(Native Method)
Click to expand...
Click to collapse
It looks like there is an error in MainActivity line 29, could you please tell me which one that is so that we can better analyze it?
From looking at the stacktrace, there is probably an error concerning one of your layouts, as it says that "setContentView" has a problem. (I have marked those lines in the stacktrace in red)
--------------------
Phone: Nexus 4
OS: rooted Lollipop LRX21T
Bootloader: unlocked
Recovery: TWRP 2.8.2.0

29 line in Main Activity (second Activity in my first post) its
"private void ListaPiosenek()" and i dont know what i can change ;/
here is XML file (Activity Main layout)
Code:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
tools:context="com.example.another.MainActivity" >
<ListView
android:id="@+id/listView1"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_above="@+id/horizontalScrollView1"
android:layout_below="@+id/editText1"
android:background="@drawable/tlo4"
android:descendantFocusability="beforeDescendants"
android:dividerHeight="2dp"
android:drawSelectorOnTop="true"
android:smoothScrollbar="true"
android:visibility="visible" >
</ListView>
<HorizontalScrollView
android:id="@+id/horizontalScrollView1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignLeft="@+id/listView1"
android:layout_alignParentBottom="true"
android:smoothScrollbar="true" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="79dp"
android:gravity="center"
android:orientation="horizontal" >
<ImageView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scaleType="centerInside"
android:src="@drawable/a" />
<ImageView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scaleType="centerInside"
android:src="@drawable/a7" />
<ImageView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scaleType="centerInside"
android:src="@drawable/am" />
<ImageView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:maxWidth="70dp"
android:scaleType="centerInside"
android:src="@drawable/am7" />
<ImageView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scaleType="centerInside"
android:src="@drawable/a6" />
<ImageView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scaleType="centerInside"
android:src="@drawable/amaj7" />
<ImageView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scaleType="centerInside"
android:src="@drawable/asus" />
<ImageView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scaleType="centerInside"
android:src="@drawable/b" />
<ImageView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scaleType="centerInside"
android:src="@drawable/b6" />
<ImageView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scaleType="centerInside"
android:src="@drawable/b7" />
<ImageView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scaleType="centerInside"
android:src="@drawable/bm" />
<ImageView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scaleType="centerInside"
android:src="@drawable/bm7" />
<ImageView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scaleType="centerInside"
android:src="@drawable/bmaj7" />
<ImageView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scaleType="centerInside"
android:src="@drawable/bsus" />
<ImageView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scaleType="centerInside"
android:src="@drawable/c" />
<ImageView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scaleType="centerInside"
android:src="@drawable/c7" />
<ImageView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scaleType="centerInside"
android:src="@drawable/cm" />
<ImageView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scaleType="centerInside"
android:src="@drawable/cmaj7" />
<ImageView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scaleType="centerInside"
android:src="@drawable/csus" />
<ImageView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scaleType="centerInside"
android:src="@drawable/d" />
<ImageView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scaleType="centerInside"
android:src="@drawable/d6" />
<ImageView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scaleType="centerInside"
android:src="@drawable/d7" />
<ImageView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scaleType="centerInside"
android:src="@drawable/dm" />
<ImageView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scaleType="centerInside"
android:src="@drawable/dm7" />
<ImageView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scaleType="centerInside"
android:src="@drawable/dmaj7" />
<ImageView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scaleType="centerInside"
android:src="@drawable/e" />
<ImageView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scaleType="centerInside"
android:src="@drawable/e6" />
<ImageView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scaleType="centerInside"
android:src="@drawable/e7" />
<ImageView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scaleType="centerInside"
android:src="@drawable/em" />
<ImageView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scaleType="centerInside"
android:src="@drawable/em7" />
<ImageView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scaleType="centerInside"
android:src="@drawable/f" />
<ImageView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scaleType="centerInside"
android:src="@drawable/f6" />
<ImageView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scaleType="centerInside"
android:src="@drawable/f7" />
<ImageView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scaleType="centerInside"
android:src="@drawable/fm" />
<ImageView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scaleType="centerInside"
android:src="@drawable/fmaj7" />
<ImageView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scaleType="centerInside"
android:src="@drawable/fsus" />
<ImageView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scaleType="centerInside"
android:src="@drawable/g" />
<ImageView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scaleType="centerInside"
android:src="@drawable/g6" />
<ImageView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scaleType="centerInside"
android:src="@drawable/g7" />
<ImageView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scaleType="centerInside"
android:src="@drawable/g9" />
<ImageView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scaleType="centerInside"
android:src="@drawable/gmaj7" />
</LinearLayout>
</HorizontalScrollView>
<EditText
android:id="@+id/editText1"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_alignBottom="@+id/imageView1"
android:layout_alignTop="@+id/imageView1"
android:layout_toRightOf="@+id/imageView1"
android:background="@drawable/szukajtlo"
android:ems="10"
android:hint="Szukaj" />
<ImageView
android:id="@+id/imageView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="@+id/listView1"
android:layout_alignParentTop="true"
android:layout_marginBottom="20sp"
android:src="@drawable/logo144" />
</RelativeLayout>

I think your issue comes from too many / too big bitmaps loaded at the same time.
Before trying to use Bitmap.recycle() ar change bitmap configure, can you check that this is your issue removing some widgets witgh bitmaps?
Can you also test by removing hardware acceleration using this:
android:hardwareAccelerated="false"

Ecrou said:
I think your issue comes from too many / too big bitmaps loaded at the same time.
Before trying to use Bitmap.recycle() ar change bitmap configure, can you check that this is your issue removing some widgets witgh bitmaps?
Can you also test by removing hardware acceleration using this:
android:hardwareAccelerated="false"
Click to expand...
Click to collapse
I will try but tell me why its not working like this, cause it was, and i have working aplication on my phone :x ?

Oh i see now, you have a huge lot of image views inside your layout, this is too memory heavy. I would recommend using a listview where one item consists of a single imageview. Like that, there are always just a few images being loaded at once and the others are recycled. This is far more memory friendly
And i cant really imagine this could have ever worked nicely before, so i wonder how you could have run your app before..
--------------------
Phone: Nexus 4
OS: rooted Lollipop LRX21T
Bootloader: unlocked
Recovery: TWRP 2.8.2.0

Masrepus said:
Oh i see now, you have a huge lot of image views inside your layout, this is too memory heavy. I would recommend using a listview where one item consists of a single imageview. Like that, there are always just a few images being loaded at once and the others are recycled. This is far more memory friendly
And i cant really imagine this could have ever worked nicely before, so i wonder how you could have run your app before..
--------------------
Phone: Nexus 4
OS: rooted Lollipop LRX21T
Bootloader: unlocked
Recovery: TWRP 2.8.2.0
Click to expand...
Click to collapse
Its still working with that many imageViews on my phone, but i think i will delete it and make another Activty and Layout, thank you guys for help .

Matma said:
Its still working with that many imageViews on my phone, but i think i will delete it and make another Activty and Layout, thank you guys for help .
Click to expand...
Click to collapse
Yeah it depends on the device's ram and the heap settings if it crashes or not. But rather be safe than sorry
--------------------
Phone: Nexus 4
OS: rooted Lollipop LRX21T
Bootloader: unlocked
Recovery: TWRP 2.8.2.0

Related

[NEWBIE] Intents not working properly..

Hey there. i was experimenting with intents.. While I got stuck in this bug. I am almost positive, that my java classes have been coded correctly...
I think, its the android manifest.. The intent filters have not been setup correctly... However I will be posting.. all of my code and the logcat here...
Please help me.. Thanks in advance!
Manifest.xml:
Code:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.intents"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="17" />
<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<activity
android:name="com.example.intents.MainActivity"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name="com.example.intents.SecondActivity"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.SecondActivity" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
</application>
</manifest>
activity_xml.xml
Code:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
tools:context=".MainActivity" >
<Button
android:layout_width = "fill_parent"
android:layout_height="wrap_content"
android:text="Click for second Activity"
android:onClick="onClick"
android:id="@+id/button1"
/>
</RelativeLayout>
second_act.xml
Code:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<TextView
android:id="@+id/tvSecond"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="Enter your name! " />
<Button
android:id="@+id/logOn"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="Hit to Login"
android:onClick = "onClick" />
</LinearLayout>
MainActivity.java
Code:
package com.example.intents;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Toast;
public class MainActivity extends Activity {
int request_Code = 1;
/** Called when the activity is first created. */
[user=439709]@override[/user]
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}
public void onClick(View v) {
Intent i = new Intent("com.example.intents.MainActivity");
i.putExtra("str1", "This is str1");
i.putExtra("age1", 16);
Bundle ex = new Bundle();
ex.putString("str2", "this is str2 and a bundle String");
ex.putInt("age2", 22);
i.putExtras(ex);
startActivityForResult(i, 1);
}
protected void onActivityResult(int requestCode, int ResultCode, Intent data) {
if (requestCode == 1) {
if (ResultCode == RESULT_OK) {
Toast.makeText(this,
Integer.toString(data.getIntExtra("age3", 0)),
Toast.LENGTH_SHORT).show();
Toast.makeText(this, data.getData().toString(),
Toast.LENGTH_LONG).show();
}
}
}
}
SecondActivity.xml
Code:
package com.example.intents;
import android.app.Activity;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;
import android.widget.Toast;
public class SecondActivity extends Activity {
[user=439709]@override[/user]
protected void onCreate(Bundle savedInstanceState) {
// TODO Auto-generated method stub
super.onCreate(savedInstanceState);
setContentView(R.layout.second_act);
Toast.makeText(this, getIntent().getStringExtra("str1"),
Toast.LENGTH_SHORT).show();
Toast.makeText(this, getIntent().getIntExtra("age1", 0),
Toast.LENGTH_SHORT).show();
Bundle bundle = getIntent().getExtras();
Toast.makeText(this, bundle.getString("str2"), Toast.LENGTH_SHORT)
.show();
Toast.makeText(this, Integer.toString(bundle.getInt("age2")),
Toast.LENGTH_SHORT).show();
}
public void onClick(View v) {
Intent i = new Intent();
i.putExtra("age3", 45);
i.setData(Uri.parse("Something has been passed to main aactivity"));
setResult(RESULT_OK, i);
finish();
}
}
Logcat[only the portion highlighted in red! ]
Uploaded here, for a better view..
hiphop12ism said:
Hey there. i was experimenting with intents.. While I got stuck in this bug. I am almost positive, that my java classes have been coded correctly...
I think, its the android manifest.. The intent filters have not been setup correctly... However I will be posting.. all of my code and the logcat here...
Please help me.. Thanks in advance!
Click to expand...
Click to collapse
OK, so first of all, in your manifest, you do not need to create an intent-filter, that is just if an activity needs to be launched from another application.
Then, when you create your Intent to start the SecondActivity, do it like this:
Code:
Intent i = new Intent(this, SecondActivity.class);
// put extras and startforResult here
The Error in the logcat states that it could not find the activity, so I suppose this is why
Code:
<activity
android:name="com.example.intents.SecondActivity"
android:label="@string/app_name" >
<intent-filter>
[B]<action android:name="[COLOR="Red"]android.intent.action.SecondActivity[/COLOR]" />[/B]
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
The bold should be referencing the same intent you are trying to call. Change the red text portion above to "com.example.intents.SecondActivity" and use the same to call the intent.
example: Intent i = new Intent("com.example.intents.SecondActivity");
The red text should match each other.
Still crashing!
zalez said:
Code:
<activity
android:name="com.example.intents.SecondActivity"
android:label="@string/app_name" >
<intent-filter>
[B]<action android:name="[COLOR="Red"]android.intent.action.SecondActivity[/COLOR]" />[/B]
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
The bold should be referencing the same intent you are trying to call. Change the red text portion above to "com.example.intents.SecondActivity" and use the same to call the intent.
example: Intent i = new Intent("com.example.intents.SecondActivity");
The red text should match each other.
Click to expand...
Click to collapse
I changed the code, as you said.. But it is still not working...
I am uploading the manifest, and the MainActivity.java again..
Mainfest:
Code:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.intents"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="17" />
<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<activity
android:name="com.example.intents.MainActivity"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name="com.example.intents.SecondActivity"
android:label="@string/app_name" >
<intent-filter>
<action android:name="com.example.intents.SecondActivity" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
</application>
</manifest>
MainActivity.java
Code:
package com.example.intents;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Toast;
public class MainActivity extends Activity {
[user=439709]@override[/user]
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}
public void onClick(View v) {
Intent i = new Intent("com.example.intents.SecondActivity");
i.putExtra("str1", "This is str1");
i.putExtra("age1", 16);
Bundle ex = new Bundle();
ex.putString("str2", "this is str2 and a bundle String");
ex.putInt("age2", 22);
i.putExtras(ex);
startActivityForResult(i, 1);
}
protected void onActivityResult(int requestCode, int ResultCode, Intent data) {
if (requestCode == 1) {
if (ResultCode == RESULT_OK) {
Toast.makeText(this,
Integer.toString(data.getIntExtra("age3", 0)),
Toast.LENGTH_SHORT).show();
Toast.makeText(this, data.getData().toString(),
Toast.LENGTH_LONG).show();
}
}
}
}
It is giving errors because of how you are trying to get the strings from the intent in SecondActivity.
replace what you have in your SecondActivity onCreate with the below.
Code:
Intent intent = getIntent();
Toast.makeText(this, intent.getStringExtra("str1"), Toast.LENGTH_LONG).show();
Toast.makeText(this, String.valueOf(intent.getIntExtra("age1", 0)), Toast.LENGTH_LONG).show();
Bundle bundle = intent.getExtras();
Toast.makeText(this, bundle.getString("str2"), Toast.LENGTH_SHORT)
.show();
Toast.makeText(this, Integer.toString(bundle.getInt("age2")),
Toast.LENGTH_SHORT).show();
Thank you, finally it worked :thumbup:
Sent from my GT-S6102 using xda app-developers app

[Q] ListView with BaseAdapter not showing

Hi I have used ListFragment and simple ArrayAdapter quite often. And now I want to try some more by customizing BaseAdapter. But something happened, the List is not showing at all. I don't have any error (the Logcat also saying there're no error). But I debug it, and found out that getView() in my customized BaseAdapter is not called. I wonder why?
Here's the snippet:
#favorite_list_layout
Code:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_height="match_parent"
android:layout_width="match_parent">
<ListView
android:id="@+id/favorite_list"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</LinearLayout>
#favorite_list_item
Code:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_height="wrap_content"
android:layout_width="match_parent"
android:orientation="vertical">
<TextView
android:id="@+id/favorite_text"
android:layout_margin="5dp"
android:layout_marginLeft="10dp"
android:layout_marginBottom="0dp"
android:textSize="35sp"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<TextView
android:id="@+id/favorite_text_details"
android:layout_marginLeft="10dp"
android:layout_marginTop="0dp"
android:layout_marginBottom="5dp"
android:fontFamily="sans-serif-light"
android:textSize="18sp"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</LinearLayout>
#FavoritesFragment
Code:
public class FavoritesFragment extends ListFragment {
[user=439709]@override[/user]
public void onActivityCreated(Bundle savedInstanceState) {
super.onActivityCreated(savedInstanceState);
//... setting variable favList, and this code is working. favList is not empty and there're no error
setListAdapter(new FavoriteAdapter(getActivity(), favList));
}
}
FavoriteAdapter, extends BaseAdapter
Code:
public class FavoriteAdapter extends BaseAdapter {
private Context ctx;
List<DMapData> list;
public FavoriteAdapter(Context context, List<DMapData> list) {
this.ctx = context;
this.list = list;
System.out.println("constructor executed!");
}
[user=439709]@override[/user]
public int getCount() {
return list.size();
}
[user=439709]@override[/user]
public Object getItem(int i) {
return list.get(i);
}
[user=439709]@override[/user]
public long getItemId(int i) {
return i;
}
[user=439709]@override[/user]
public View getView(int position, View convertView, ViewGroup parent) {
System.out.println("GetView is executed"); //But it's not.
View rowView = convertView;
if (rowView == null) {
LayoutInflater inflater = (LayoutInflater) ctx
.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
rowView = inflater.inflate(R.layout.favorite_list_item, parent, false);
}
TextView favText = (TextView) rowView.findViewById(R.id.favorite_text);
TextView detailsText = (TextView) rowView.findViewById(R.id.favorite_text_details);
DMapData data = list.get(position);
System.out.println("DMapData from List");
favText.setText(data.getName());
detailsText.setText(data.getDetails().length()<=50? data.getDetails() : data.getDetails().substring(0, 51).concat("..."));
System.out.println("At the end of getView()");
return rowView;
}
}
Thanks
The id of the ListView has to be a special one so that the ListFragment can find it:
Code:
android:id="@android:id/list"
Hmm...
I have tried to change the id like your code. But, still not shown up. Is there anything I should do with my ListFragment?
nikwen said:
The id of the ListView has to be a special one so that the ListFragment can find it:
Code:
android:id="@android:id/list"
Click to expand...
Click to collapse
JoshieGeek said:
Hmm...
I have tried to change the id like your code. But, still not shown up. Is there anything I should do with my ListFragment?
Click to expand...
Click to collapse
Do you inflate your layout?
Code:
[user=439709]@override[/user]
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
return inflater.inflate(R.layout.fragment_layout, container, false);
}
I always set the adapter in onCreate but there shouldn't be a difference.
Your layout looks like that now, right?
Code:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_height="match_parent"
android:layout_width="match_parent">
<ListView
android:id="android:id/list"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</LinearLayout>
EDIT: Oh, add an orientation to the LinearLayout or replace it by a RelativeLayout.
And change the ListView heigth to match_parent.
Yupz. But still no different.
Here's my changed code. I have changed not using my customized adapter again, but instead using SimpleAdapter.
/res/layout/favorite_list_layout.xml
Code:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_height="match_parent"
android:layout_width="match_parent">
<ListView
android:id="@android:id/list"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</LinearLayout>
/res/layout/favorite_list_item
Code:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_height="wrap_content"
android:layout_width="match_parent"
android:orientation="vertical">
<TextView
android:id="@+id/favorite_text"
android:layout_margin="5dp"
android:layout_marginLeft="10dp"
android:layout_marginBottom="0dp"
android:textSize="35sp"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<TextView
android:id="@+id/favorite_text_details"
android:layout_marginLeft="10dp"
android:layout_marginTop="0dp"
android:layout_marginBottom="5dp"
android:fontFamily="sans-serif-light"
android:textSize="18sp"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</LinearLayout>
/src/.../AllFragment.java
Code:
public class AllFragment extends ListFragment {
[user=439709]@override[/user]
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
//TODO get All Data
//Let's just adopt Favorite List Adapter for now
MasterDataReader mdReader = new MasterDataReader();
mdReader.execute();
List<DMapData> allList = new ArrayList<DMapData>();
allList.add(new DMapData("Empty", "No data found!"));
try {
allList = mdReader.get();
System.out.println("All List received");
} catch (InterruptedException e) {
e.printStackTrace();
} catch (ExecutionException e) {
e.printStackTrace();
}
List<Map<String, String>> finList = new ArrayList<Map<String, String>>();
for(DMapData data : allList) {
Map<String, String> m = new HashMap<String, String>();
m.put("name", data.getName());
m.put("detail", data.getDetails().length()<=50? data.getDetails() : data.getDetails().substring(0, 51).concat("..."));
finList.add(m);
}
String[] colNames = new String[] {
"name", "detail"
};
int[] tView = new int[] {
R.id.favorite_text, R.id.favorite_text_details
};
SimpleAdapter simpleAdapter = new SimpleAdapter(getActivity(), finList, R.layout.favorite_list_layout,
colNames, tView);
setListAdapter(simpleAdapter);
}
[user=439709]@override[/user]
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
return inflater.inflate(R.layout.favorite_list_layout, container, false);
}
}
What do you think?
nikwen said:
Do you inflate your layout?
Code:
[user=439709]@override[/user]
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
return inflater.inflate(R.layout.fragment_layout, container, false);
}
I always set the adapter in onCreate but there shouldn't be a difference.
Your layout looks like that now, right?
Code:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_height="match_parent"
android:layout_width="match_parent">
<ListView
android:id="android:id/list"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</LinearLayout>
EDIT: Oh, add an orientation to the LinearLayout or replace it by a RelativeLayout.
And change the ListView heigth to match_parent.
Click to expand...
Click to collapse
JoshieGeek said:
Yupz. But still no different.
Here's my changed code. I have changed not using my customized adapter again, but instead using SimpleAdapter.
/res/layout/favorite_list_layout.xml
Code:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_height="match_parent"
android:layout_width="match_parent">
<ListView
android:id="@android:id/list"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</LinearLayout>
/res/layout/favorite_list_item
Code:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_height="wrap_content"
android:layout_width="match_parent"
android:orientation="vertical">
<TextView
android:id="@+id/favorite_text"
android:layout_margin="5dp"
android:layout_marginLeft="10dp"
android:layout_marginBottom="0dp"
android:textSize="35sp"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<TextView
android:id="@+id/favorite_text_details"
android:layout_marginLeft="10dp"
android:layout_marginTop="0dp"
android:layout_marginBottom="5dp"
android:fontFamily="sans-serif-light"
android:textSize="18sp"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</LinearLayout>
/src/.../AllFragment.java
Code:
public class AllFragment extends ListFragment {
[user=439709]@override[/user]
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
//TODO get All Data
//Let's just adopt Favorite List Adapter for now
MasterDataReader mdReader = new MasterDataReader();
mdReader.execute();
List<DMapData> allList = new ArrayList<DMapData>();
allList.add(new DMapData("Empty", "No data found!"));
try {
allList = mdReader.get();
System.out.println("All List received");
} catch (InterruptedException e) {
e.printStackTrace();
} catch (ExecutionException e) {
e.printStackTrace();
}
List<Map<String, String>> finList = new ArrayList<Map<String, String>>();
for(DMapData data : allList) {
Map<String, String> m = new HashMap<String, String>();
m.put("name", data.getName());
m.put("detail", data.getDetails().length()<=50? data.getDetails() : data.getDetails().substring(0, 51).concat("..."));
finList.add(m);
}
String[] colNames = new String[] {
"name", "detail"
};
int[] tView = new int[] {
R.id.favorite_text, R.id.favorite_text_details
};
SimpleAdapter simpleAdapter = new SimpleAdapter(getActivity(), finList, R.layout.favorite_list_layout,
colNames, tView);
setListAdapter(simpleAdapter);
}
[user=439709]@override[/user]
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
return inflater.inflate(R.layout.favorite_list_layout, container, false);
}
}
What do you think?
Click to expand...
Click to collapse
Try this layout:
Code:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<ListView
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:id="@android:id/list"
android:layout_alignParentTop="true"
android:fastScrollEnabled="true" />
<ProgressBar
android:id="@android:id/empty"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
style="?android:attr/progressBarStyle" />
</RelativeLayout>
It's working for me.
Did you try to write all entries to the logs? Do you get an output?
You know what? This is really make me laugh all the time, that it's because what I think is right but actually not. The list that I provided for my ListView is actually empty. Your layout tell me, because there's always the progressbar. Thank you very much for your help. :highfive:
nikwen said:
Try this layout:
Code:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<ListView
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:id="@android:id/list"
android:layout_alignParentTop="true"
android:fastScrollEnabled="true" />
<ProgressBar
android:id="@android:id/empty"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
style="?android:attr/progressBarStyle" />
</RelativeLayout>
It's working for me.
Did you try to write all entries to the logs? Do you get an output?
Click to expand...
Click to collapse
JoshieGeek said:
You know what? This is really make me laugh all the time, that it's because what I think is right but actually not. The list that I provided for my ListView is actually empty. Your layout tell me, because there's always the progressbar. Thank you very much for your help. :highfive:
Click to expand...
Click to collapse
Welcome.
I'm glad that you solved that because it began to drive me crazy. :laugh:
@JoshieGeek
consider using Log
Log.i("class/functionName","message you want to display");
Click to expand...
Click to collapse
It will be easy to debug
Sandeep_Jagtap said:
@JoshieGeek
consider using Log
It will be easy to debug
Click to expand...
Click to collapse
Didn't you see that he already solved his problem?
nikwen said:
Didn't you see that he already solved his problem?
Click to expand...
Click to collapse
Yes its quite noticeable
As he was saying he could not see error in Log while debugging. My advice to use log was for his future projects.
Sent from my Incredible S using xda app-developers app
Sandeep_Jagtap said:
Yes its quite noticeable
As he was saying he could not see error in Log while debugging. My advice to use log was for his future projects.
Sent from my Incredible S using xda app-developers app
Click to expand...
Click to collapse
OK.
Check out my guide on debugging here: http://forum.xda-developers.com/showthread.php?t=2325164

[Q] setText don't change text

Hello all, I have problem in I developing a program for learning purposes also for my school. So here is the code, also my code not completed so there any problem please write how to fix
Code:
package com.leftas.vidurkioskaiciavimas;
import android.os.Bundle;
import android.app.Activity;
import android.view.View;
import android.widget.TextView;
public class vidurkioskaiciuokle extends Activity {
int c;
TextView mUserOutput,mUserInput;
[user=439709]@override[/user]
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.vidurkio_skaiciuokle);
TextView mUserOutput = (TextView) findViewById(R.id.textView2);
TextView mUserInput = (TextView) findViewById(R.id.textView);
}
private void buttonEventHandler(View v) {
switch(v.getId()) {
case R.id.button1 :
mUserInput.setText(mUserInput.getText() + "1");
c = +1;
break;
case R.id.button2 :
mUserInput.setText(mUserInput.getText() + "2");
c = +2;
break;
case R.id.button3 :
mUserInput.setText(mUserInput.getText() + "3");
c = +3;
break;
case R.id.button4 :
mUserInput.setText(mUserInput.getText() + "4");
c = +4;
break;
case R.id.button5 :
mUserInput.setText(mUserInput.getText() + "5");
c = +5;
break;
case R.id.button6 :
mUserInput.setText(mUserInput.getText() + "6");
c = +6;
break;
case R.id.button7 :
mUserInput.setText(mUserInput.getText() + "7");
c = +7;
break;
case R.id.button8 :
mUserInput.setText(mUserInput.getText() + "8");
c = +8;
break;
case R.id.button9 :
mUserInput.setText(mUserInput.getText() + "9");
c = +9;
break;
case R.id.button10 :
mUserInput.setText(mUserInput.getText() + "10");
c = +10;
break;
}
}
public void computeAverage(int [] scores)
{
double average = 0;
for (int c : scores) {
average += c;
}
average /= scores.length;
mUserOutput.setText(Double.toString(average));
}
}
So when I press 1,2,3,4,5,6,7,8,9,10 it doesn't change any text..
Also if this not Q&A Forum please move it(Report it) Because I searched where i can post and only found here
My solution
Code:
mUserOutput = (TextView) findViewById(R.id.textView2);
mUserInput = (TextView) findViewById(R.id.textView);
Could you please post your xml file, too?
What happens if you add this to the switch statement?
Code:
default:
Log.d("switch", "default");
break;
Do you see it in the logs?
Btw, it is the right subforum.
Nothing happens, even message doesn't appear.
Xml file:
Code:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
android:paddingBottom="@dimen/activity_vertical_margin"
tools:context=".vidurkioskaiciuokle">
<Button
style="?android:attr/buttonStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="1"
android:id="@+id/button1"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true" />
<Button
style="?android:attr/buttonStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="2"
android:id="@+id/button2"
android:layout_alignTop="@+id/button1"
android:layout_toRightOf="@+id/button1" />
<Button
style="?android:attr/buttonStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="3"
android:id="@+id/button3"
android:layout_alignBottom="@+id/button2"
android:layout_toRightOf="@+id/button2" />
<Button
style="?android:attr/buttonStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="4"
android:id="@+id/button4"
android:layout_alignTop="@+id/button3"
android:layout_toRightOf="@+id/button3" />
<Button
style="?android:attr/buttonStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="5"
android:id="@+id/button5"
android:layout_alignTop="@+id/button4"
android:layout_toRightOf="@+id/button4" />
<Button
style="?android:attr/buttonStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="6"
android:id="@+id/button6"
android:layout_alignTop="@+id/button5"
android:layout_toRightOf="@+id/button5" />
<Button
style="?android:attr/buttonStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="7"
android:id="@+id/button7"
android:layout_alignBottom="@+id/button6"
android:layout_toRightOf="@+id/button6" />
<Button
style="?android:attr/buttonStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="8"
android:id="@+id/button8"
android:layout_alignTop="@+id/button9"
android:layout_toLeftOf="@+id/button9" />
<Button
style="?android:attr/buttonStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="9"
android:id="@+id/button9"
android:layout_above="@+id/button2"
android:layout_toLeftOf="@+id/button3" />
<Button
style="?android:attr/buttonStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="10"
android:id="@+id/button10"
android:layout_alignTop="@+id/button9"
android:layout_toRightOf="@+id/button9" />
<TextView
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:id="@+id/textView"
android:layout_above="@+id/textView2"
android:layout_alignRight="@+id/textView2" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/textView2"
android:layout_alignParentStart="false"
android:layout_alignParentEnd="false"
android:layout_alignWithParentIfMissing="false"
android:layout_above="@+id/button8"
android:layout_toLeftOf="@+id/button7"
android:layout_alignLeft="@+id/button8" />
</RelativeLayout>
Paulius7 said:
Nothing happens, even message doesn't appear.
Xml file:
Code:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
android:paddingBottom="@dimen/activity_vertical_margin"
tools:context=".vidurkioskaiciuokle">
<Button
style="?android:attr/buttonStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="1"
android:id="@+id/button1"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true" />
<Button
style="?android:attr/buttonStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="2"
android:id="@+id/button2"
android:layout_alignTop="@+id/button1"
android:layout_toRightOf="@+id/button1" />
<Button
style="?android:attr/buttonStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="3"
android:id="@+id/button3"
android:layout_alignBottom="@+id/button2"
android:layout_toRightOf="@+id/button2" />
<Button
style="?android:attr/buttonStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="4"
android:id="@+id/button4"
android:layout_alignTop="@+id/button3"
android:layout_toRightOf="@+id/button3" />
<Button
style="?android:attr/buttonStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="5"
android:id="@+id/button5"
android:layout_alignTop="@+id/button4"
android:layout_toRightOf="@+id/button4" />
<Button
style="?android:attr/buttonStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="6"
android:id="@+id/button6"
android:layout_alignTop="@+id/button5"
android:layout_toRightOf="@+id/button5" />
<Button
style="?android:attr/buttonStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="7"
android:id="@+id/button7"
android:layout_alignBottom="@+id/button6"
android:layout_toRightOf="@+id/button6" />
<Button
style="?android:attr/buttonStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="8"
android:id="@+id/button8"
android:layout_alignTop="@+id/button9"
android:layout_toLeftOf="@+id/button9" />
<Button
style="?android:attr/buttonStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="9"
android:id="@+id/button9"
android:layout_above="@+id/button2"
android:layout_toLeftOf="@+id/button3" />
<Button
style="?android:attr/buttonStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="10"
android:id="@+id/button10"
android:layout_alignTop="@+id/button9"
android:layout_toRightOf="@+id/button9" />
<TextView
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:id="@+id/textView"
android:layout_above="@+id/textView2"
android:layout_alignRight="@+id/textView2" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/textView2"
android:layout_alignParentStart="false"
android:layout_alignParentEnd="false"
android:layout_alignWithParentIfMissing="false"
android:layout_above="@+id/button8"
android:layout_toLeftOf="@+id/button7"
android:layout_alignLeft="@+id/button8" />
</RelativeLayout>
Click to expand...
Click to collapse
Ah, add this to all buttons:
Code:
android:[U][/U]onClick="buttonEventHandler"
Hello again, now my program crash(Force Close) when I press one of buttons.
updated code
Code:
package com.leftas.vidurkioskaiciavimas;
import android.content.Intent;
import android.os.Bundle;
import android.app.Activity;
import android.util.Log;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import android.view.View;
import android.widget.TextView;
public class vidurkioskaiciuokle extends Activity {
int c;
TextView mUserOutput,mUserInput;
[user=439709]@override[/user]
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.vidurkio_skaiciuokle);
TextView mUserOutput = (TextView) findViewById(R.id.textView2);
TextView mUserInput = (TextView) findViewById(R.id.textView);
}
public boolean onCreateOptionsMenu(Menu menu) {
MenuInflater inflater = getMenuInflater();
inflater.inflate(R.menu.vidurkioskaiciuokle, menu);
return true;
}
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
case R.id.about:
startActivity(new Intent(this, About.class));
return true;
case R.id.exit:
finish();
return true;
default:
return super.onOptionsItemSelected(item);
}
}
private void buttonEventHandler(View v) {
switch(v.getId()) {
case R.id.button1 :
mUserInput.setText(mUserInput.getText() + "1");
c = +1;
break;
case R.id.button2 :
mUserInput.setText(mUserInput.getText() + "2");
c = +2;
break;
case R.id.button3 :
mUserInput.setText(mUserInput.getText() + "3");
c = +3;
break;
case R.id.button4 :
mUserInput.setText(mUserInput.getText() + "4");
c = +4;
break;
case R.id.button5 :
mUserInput.setText(mUserInput.getText() + "5");
c = +5;
break;
case R.id.button6 :
mUserInput.setText(mUserInput.getText() + "6");
c = +6;
break;
case R.id.button7 :
mUserInput.setText(mUserInput.getText() + "7");
c = +7;
break;
case R.id.button8 :
mUserInput.setText(mUserInput.getText() + "8");
c = +8;
break;
case R.id.button9 :
mUserInput.setText(mUserInput.getText() + "9");
c = +9;
break;
case R.id.button10 :
mUserInput.setText(mUserInput.getText() + "10");
c = +10;
break;
case R.id.buttonclear :
mUserOutput.setText(null);
mUserInput.setText(null);
c = 0;
double average = 0;
}
}
public void computeAverage(int [] scores)
{
double average = 0;
for (int c : scores) {
average += c;
}
average /= scores.length;
mUserOutput.setText(Double.toString(average));
}
}
Xml File
Code:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
android:paddingBottom="@dimen/activity_vertical_margin"
tools:context=".vidurkioskaiciuokle">
<Button
style="?android:attr/buttonStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="1"
android:id="@+id/button1"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:onClick="buttonEventHandler" />
<Button
style="?android:attr/buttonStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="2"
android:id="@+id/button2"
android:layout_alignTop="@+id/button1"
android:layout_toRightOf="@+id/button1"
android:onClick="buttonEventHandler" />
<Button
style="?android:attr/buttonStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="3"
android:id="@+id/button3"
android:layout_alignBottom="@+id/button2"
android:layout_toRightOf="@+id/button2"
android:onClick="buttonEventHandler" />
<Button
style="?android:attr/buttonStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="4"
android:id="@+id/button4"
android:layout_alignTop="@+id/button3"
android:layout_toRightOf="@+id/button3"
android:onClick="buttonEventHandler" />
<Button
style="?android:attr/buttonStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="5"
android:id="@+id/button5"
android:layout_alignTop="@+id/button4"
android:layout_toRightOf="@+id/button4"
android:onClick="buttonEventHandler" />
<Button
style="?android:attr/buttonStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="6"
android:id="@+id/button6"
android:layout_alignTop="@+id/button5"
android:layout_toRightOf="@+id/button5"
android:onClick="buttonEventHandler" />
<Button
style="?android:attr/buttonStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="7"
android:id="@+id/button7"
android:layout_above="@+id/button2"
android:layout_toRightOf="@+id/button2"
android:onClick="buttonEventHandler" />
<Button
style="?android:attr/buttonStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="8"
android:id="@+id/button8"
android:layout_alignTop="@+id/button9"
android:layout_toLeftOf="@+id/button9"
android:onClick="buttonEventHandler" />
<Button
style="?android:attr/buttonStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="9"
android:id="@+id/button9"
android:layout_above="@+id/button2"
android:layout_toLeftOf="@+id/button3"
android:onClick="buttonEventHandler" />
<Button
style="?android:attr/buttonStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="10"
android:id="@+id/button10"
android:layout_above="@+id/button4"
android:layout_toLeftOf="@+id/button5"
android:onClick="buttonEventHandler" />
<TextView
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:id="@+id/textView"
android:layout_above="@+id/textView2"
android:layout_alignParentRight="true" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/textView2"
android:layout_alignParentStart="false"
android:layout_alignParentEnd="false"
android:layout_alignWithParentIfMissing="false"
android:layout_above="@+id/button8"
android:layout_alignLeft="@+id/button8"
android:layout_alignRight="@+id/textView" />
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Clear"
android:id="@+id/buttonclear"
android:layout_above="@+id/button5"
android:layout_alignRight="@+id/button6"
android:layout_alignLeft="@+id/button5"
android:onClick="buttonEventHandler" />
</RelativeLayout>
Your buttonEventHandler method needs to be public.
Still Force Close even Public void. Also When I go to "About" also crash
Code:
package com.leftas.vidurkioskaiciavimas;
import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.content.res.AssetManager;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.preference.DialogPreference;
import android.util.AttributeSet;
import android.util.Log;
import android.view.View;
import android.widget.EditText;
import android.widget.TextView;
import com.leftas.vidurkioskaiciavimas.vidurkioskaiciuokle;
public class About extends Activity implements View.OnClickListener {
TextView bug ;
[user=439709]@override[/user]
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.about);
bug = (TextView)findViewById(R.id.textViewbug);
bug.setOnClickListener(this);
}
private String bugReport = "Description\n" + "===========\n" + "Enter Your Problem" + "\n" + "\nAdditional Info\n" + "===========\n" + "App version: "
+ "1.0" + "Device: " + Build.MODEL + "\n" + "Android version: " + Build.VERSION.RELEASE + "\n" + "Firmware fingerprint: " + Build.FINGERPRINT + "\n";
public void onClick(View v) {
Intent gmail = new Intent(Intent.ACTION_VIEW);
gmail.setClassName("com.google.android.gm","com.google.android.gm.ComposeActivityGmail");
gmail.putExtra(Intent.EXTRA_EMAIL, new String[] { "..." });
gmail.setData(Uri.parse("..."));
gmail.putExtra(Intent.EXTRA_SUBJECT, "Bug Report: Vidurkio Skaičiavimas");
gmail.setType("plain/text");
gmail.putExtra(Intent.EXTRA_TEXT, bugReport);
startActivity(gmail);
}
}
Xml
Code:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" android:layout_width="match_parent"
android:layout_height="match_parent"
android:baselineAligned="false">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceLarge"
android:text="Kurėjas:Paulius Karlonas(Leftas)"
android:id="@+id/textView"
android:layout_gravity="center" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceMedium"
android:text="El.Paštas:...."
android:id="@+id/textView2"
android:layout_gravity="center" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceLarge"
android:text="Radai Klaidų ? Rašyk"
android:id="@+id/textViewbug"
android:layout_gravity="center"
android:clickable="true"
android:onClick="onClick" />
</LinearLayout>
It's Lithuanian Language, So you could don't understand that
Paulius7 said:
Still Force Close even Public void. Also When I go to "About" also crash
Code:
package com.leftas.vidurkioskaiciavimas;
import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.content.res.AssetManager;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.preference.DialogPreference;
import android.util.AttributeSet;
import android.util.Log;
import android.view.View;
import android.widget.EditText;
import android.widget.TextView;
import com.leftas.vidurkioskaiciavimas.vidurkioskaiciuokle;
public class About extends Activity implements View.OnClickListener {
TextView bug ;
[user=439709]@override[/user]
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.about);
bug = (TextView)findViewById(R.id.textViewbug);
bug.setOnClickListener(this);
}
private String bugReport = "Description\n" + "===========\n" + "Enter Your Problem" + "\n" + "\nAdditional Info\n" + "===========\n" + "App version: "
+ "1.0" + "Device: " + Build.MODEL + "\n" + "Android version: " + Build.VERSION.RELEASE + "\n" + "Firmware fingerprint: " + Build.FINGERPRINT + "\n";
public void onClick(View v) {
Intent gmail = new Intent(Intent.ACTION_VIEW);
gmail.setClassName("com.google.android.gm","com.google.android.gm.ComposeActivityGmail");
gmail.putExtra(Intent.EXTRA_EMAIL, new String[] { "[email protected]" });
gmail.setData(Uri.parse("[email protected]"));
gmail.putExtra(Intent.EXTRA_SUBJECT, "Bug Report: John Doe");
gmail.setType("plain/text");
gmail.putExtra(Intent.EXTRA_TEXT, bugReport);
startActivity(gmail);
}
}
Xml
Code:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" android:layout_width="match_parent"
android:layout_height="match_parent"
android:baselineAligned="false">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceLarge"
android:text="Kurėjas:Paulius Karlonas(Leftas)"
android:id="@+id/textView"
android:layout_gravity="center" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceMedium"
android:text="[email protected]"
android:id="@+id/textView2"
android:layout_gravity="center" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceLarge"
android:text="Radai Klaidų ? Rašyk"
android:id="@+id/textViewbug"
android:layout_gravity="center"
android:clickable="true"
android:onClick="onClick" />
</LinearLayout>
It's Lithuanian Language, So you could don't understand that
Click to expand...
Click to collapse
Please post a logcat. (Just the part with the crash.)
We need the information in it to help you.
---------- Post added at 12:39 PM ---------- Previous post was at 12:36 PM ----------
In the second example you already set a listener:
Code:
bug.setOnClickListener(this);
So no need for
Code:
android:[B][/B]onClick
Problem is that I am programming in my phone with aide. I can see logcat but I can't copy it... maybe you know how to debug from ?
Sent from my GT-I9100 using Tapatalk 4
Paulius7 said:
Problem is that I am programming in my phone with aide. I can see logcat but I can't copy it... maybe you know how to debug from ?
Sent from my GT-I9100 using Tapatalk 4
Click to expand...
Click to collapse
I developed with AIDE, too. I always used aLogcat for that.
nikwen said:
I developed with AIDE, too. I always used aLogcat for that.
Click to expand...
Click to collapse
Now build with aide and even not start in Windows developing with android studio
Code:
I/PackageManager( 2911): Package com.leftas.vidurkioskaiciavimas codePath changed from /data/app/com.leftas.vidurkioskaiciavimas-2.apk to /data/app/com.leftas.vidurkioskaiciavimas-1.apk; Retaining data and using new
E/AndroidRuntime(26441): java.lang.RuntimeException: Unable to instantiate application com.leftas.vidurkioskaiciavimas.ApplicationContextProvider: java.lang.ClassNotFoundException: com.leftas.vidurkioskaiciavimas.ApplicationContextProvider
E/AndroidRuntime(26441): Caused by: java.lang.ClassNotFoundException: com.leftas.vidurkioskaiciavimas.ApplicationContextProvider
I/ActivityManager( 2911): Process com.leftas.vidurkioskaiciavimas (pid 26441) (adj 9) has died.
when I will be with pc will try to build and save logcat then.
Sent from my GT-I9100 using Tapatalk 4
Sorry for double post...
Button logcat
Code:
E/AndroidRuntime( 3887): at com.leftas.vidurkioskaiciavimas.vidurkioskaiciuokle.buttonEventHandler(vidurkioskaiciuokle.java:96)
I/ActivityManager( 2911): Process com.leftas.vidurkioskaiciavimas (pid 3887) (adj 1) has died.
I/Icing.InternalIcingCorporaProvider( 4100): Updating corpora: A: com.leftas.vidurkioskaiciavimas, C: MAYBE
D/PackageAddedReceiver( 856): package added com.leftas.vidurkioskaiciavimas
Android Studio
Code:
09-01 17:35:06.414 5616-5616/com.leftas.vidurkioskaiciavimas W/dalvikvm: threadid=1: thread exiting with uncaught exception (group=0x41b202a0)
09-01 17:35:06.442 5616-5616/com.leftas.vidurkioskaiciavimas E/AndroidRuntime: FATAL EXCEPTION: main
java.lang.IllegalStateException: Could not execute method of the activity
at android.view.View$1.onClick(View.java:3704)
at android.view.View.performClick(View.java:4232)
at android.view.View$PerformClick.run(View.java:17298)
at android.os.Handler.handleCallback(Handler.java:615)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4921)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1027)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:794)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.reflect.InvocationTargetException
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at android.view.View$1.onClick(View.java:3699)
... 11 more
Caused by: java.lang.NullPointerException
at com.leftas.vidurkioskaiciavimas.vidurkioskaiciuokle.buttonEventHandler(vidurkioskaiciuokle.java:96)
... 14 more
"About" I was didin't declarate in AndroidManifest
Paulius7 said:
Sorry for double post...
Button logcat
Code:
E/AndroidRuntime( 3887): at com.leftas.vidurkioskaiciavimas.vidurkioskaiciuokle.buttonEventHandler(vidurkioskaiciuokle.java:96)
I/ActivityManager( 2911): Process com.leftas.vidurkioskaiciavimas (pid 3887) (adj 1) has died.
I/Icing.InternalIcingCorporaProvider( 4100): Updating corpora: A: com.leftas.vidurkioskaiciavimas, C: MAYBE
D/PackageAddedReceiver( 856): package added com.leftas.vidurkioskaiciavimas
Android Studio
Code:
09-01 17:35:06.414 5616-5616/com.leftas.vidurkioskaiciavimas W/dalvikvm: threadid=1: thread exiting with uncaught exception (group=0x41b202a0)
09-01 17:35:06.442 5616-5616/com.leftas.vidurkioskaiciavimas E/AndroidRuntime: FATAL EXCEPTION: main
java.lang.IllegalStateException: Could not execute method of the activity
at android.view.View$1.onClick(View.java:3704)
at android.view.View.performClick(View.java:4232)
at android.view.View$PerformClick.run(View.java:17298)
at android.os.Handler.handleCallback(Handler.java:615)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4921)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1027)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:794)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.reflect.InvocationTargetException
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at android.view.View$1.onClick(View.java:3699)
... 11 more
Caused by: java.lang.NullPointerException
at com.leftas.vidurkioskaiciavimas.vidurkioskaiciuokle.buttonEventHandler(vidurkioskaiciuokle.java:96)
... 14 more
"About" I was didin't declarate in AndroidManifest
Click to expand...
Click to collapse
Is that the logcat for the clear button? If it is, this might be the solution:
Replace
Code:
mUserOutput.setText(null);
mUserInput.setText(null);
by
Code:
mUserOutput.setText("");
mUserInput.setText("");
There should be a different logcat for the other buttons though.
Clear Button
Android Studio
Code:
4590-4590/com.leftas.vidurkioskaiciavimas E/AndroidRuntime: FATAL EXCEPTION: main
java.lang.IllegalStateException: Could not execute method of the activity
at android.view.View$1.onClick(View.java:3704)
at android.view.View.performClick(View.java:4232)
at android.view.View$PerformClick.run(View.java:17298)
at android.os.Handler.handleCallback(Handler.java:615)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4921)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1027)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:794)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.reflect.InvocationTargetException
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at android.view.View$1.onClick(View.java:3699)
... 11 more
Caused by: java.lang.NullPointerException
at com.leftas.vidurkioskaiciavimas.vidurkioskaiciuokle.buttonEventHandler(vidurkioskaiciuokle.java:101)
... 14 more
ALogCat
Code:
E/AndroidRuntime( 2599): at com.leftas.vidurkioskaiciavimas.vidurkioskaiciuokle.buttonEventHandler(vidurkioskaiciuokle.java:101)
I/ActivityManager( 2911): Process com.leftas.vidurkioskaiciavimas (pid 2599) (adj 1) has died.
10
6531-6531/com.leftas.vidurkioskaiciavimas E/AndroidRuntime: FATAL EXCEPTION: main
java.lang.IllegalStateException: Could not execute method of the activity
at android.view.View$1.onClick(View.java:3704)
at android.view.View.performClick(View.java:4232)
at android.view.View$PerformClick.run(View.java:17298)
at android.os.Handler.handleCallback(Handler.java:615)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4921)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1027)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:794)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.reflect.InvocationTargetException
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at android.view.View$1.onClick(View.java:3699)
... 11 more
Caused by: java.lang.NullPointerException
at com.leftas.vidurkioskaiciavimas.vidurkioskaiciuokle.buttonEventHandler(vidurkioskaiciuokle.java:96)
... 14 more
Click to expand...
Click to collapse
ALogCat
Code:
E/AndroidRuntime( 6531): at com.leftas.vidurkioskaiciavimas.vidurkioskaiciuokle.buttonEventHandler(vidurkioskaiciuokle.java:96)
All codes same just change : "number" of their line ...
Could you please tell me which line it is? (I mean the line in the source code, not just the number.)
"Clear"
Code:
mUserOutput.setText("");
"10"
Code:
mUserInput.setText(mUserInput.getText() + "10");
If you want that ?
Paulius7 said:
"Clear"
Code:
mUserOutput.setText("");
"10"
Code:
mUserInput.setText(mUserInput.getText() + "10");
If you want that ?
Click to expand...
Click to collapse
Yes, that's what I wanted. Thanks. :good:
That means that both TextViews are null. I guess that the Activity cannot find them.
Do you get a output in the logs if you replace your onCreate method with this:
Code:
[user=439709]@override[/user]
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.vidurkio_skaiciuokle);
TextView mUserOutput = (TextView) findViewById(R.id.textView2);
TextView mUserInput = (TextView) findViewById(R.id.textView);
if (mUserOutput == null)
Log.e("output", null);
if (mUserInput == null)
Log.e("input", null);
}
---------- Post added at 10:13 PM ---------- Previous post was at 10:11 PM ----------
Oh, just saw a big mistake:
You always use @+id/...
However, @+id is just used to introduce new ids in the android:id attribute.
In all other cases use @id/ (without the +).
---------- Post added at 10:15 PM ---------- Previous post was at 10:13 PM ----------
One example (needs to be fixed for all views):
Code:
<TextView
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:id="@+id/textView"
android:layout_above="[COLOR="Red"]@id[/COLOR]/textView2"
android:layout_alignRight="[COLOR="Red"]@id[/COLOR]/textView2" />
Fixed:
Code:
mUserOutput = (TextView) findViewById(R.id.textView2);
mUserInput = (TextView) findViewById(R.id.textView);
But now problem that don't change text(Input works but Output just don't output anything)
Code:
public void computeAverage(int [] c)
{
double average = 0;
for (int i = 0; i < c.length; i++)
{
average += c[i];
Log.d("TAG", "Average calculated");
}
average /= c.length;
mUserOutput.setText(Double.toString(average));
Log.d("TAG", "Showing average");
}
No log, too.
But output works
Code:
case R.id.button3 :
mUserInput.setText(mUserInput.getText() + "3" + "+");
mUserOutput.setText("3.0");
c = +3;
break;
It changes text.
I know that is nothing calling computeAverage how to do that when I click 10(It show only 10) and 9(It show 9.5 in output) that show mean(9.5) of these numbers ?
Paulius7 said:
Fixed:
Code:
mUserOutput = (TextView) findViewById(R.id.textView2);
mUserInput = (TextView) findViewById(R.id.textView);
But now problem that don't change text(Input works but Output just don't output anything)
Code:
public void computeAverage(int [] c)
{
double average = 0;
for (int i = 0; i < c.length; i++)
{
average += c[i];
Log.d("TAG", "Average calculated");
}
average /= c.length;
mUserOutput.setText(Double.toString(average));
Log.d("TAG", "Showing average");
}
No log, too.
But output works
Code:
case R.id.button3 :
mUserInput.setText(mUserInput.getText() + "3" + "+");
mUserOutput.setText("3.0");
c = +3;
break;
It changes text.
I know that is nothing calling computeAverage how to do that when I click 10(It show only 10) and 9(It show 9.5 in output) that show mean(9.5) of these numbers ?
Click to expand...
Click to collapse
You need to cast the length to double:
Code:
public void computeAverage(int [] c)
{
double average = 0;
for (int i = 0; i < c.length; i++)
{
average += c[i];
Log.d("TAG", "Average calculated");
}
average /= ((double) c.length);
mUserOutput.setText(Double.toString(average));
Log.d("TAG", "Showing average");
}
For question #2:
Add another field "lastNumber" of type double to your class:
Code:
double lastNumber = -1;
Then do this in onClick:
Code:
case R.id.button3 :
c = +3;
if (lastNumber == -1) {
mUserInput.setText(mUserInput.getText() + "3" + "+");
mUserOutput.setText("3.0");
lastNumber = 3;
} else {
//call your computeAverageMethod here
lastNumber = 3;
}
break;
My question just one, How to make that computeAverage will work ? because now none calling him so it's give no result(It don't change text when I click on buttons :/)
About Question #2 I just showed that mUserOutput works
My English sucks.....

Widget not working

Hey, fellas.. I was learning about widgets. But I got stuck at the very beginning. I was trying to make the simplest of a widget. Firstly, I made an app, that only has one textview on it. When clicked , it shows the number of times it has been clicked. Then I tried to make a widget of the same.
But when I click over the widget, nothing happens. It just shows the initialized number '0'. The debugging goes fine. There is no ANR errors.
But I am not able to figure out the logical error. As the debugging goes alright, I don't think, the logcat will be necessary.
However, If required , I will provide it too. For now, I am uploading the AppWidget.class, widget.xml, manifest.xml, widget_provider.xml :::
THE APPWIDGET.CLASS:
Code:
package com.example.increment;
import android.app.IntentService;
import android.app.PendingIntent;
import android.appwidget.AppWidgetManager;
import android.appwidget.AppWidgetProvider;
import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
import android.widget.RemoteViews;
public class AppWidget extends AppWidgetProvider {
int c = 0;
[user=439709]@override[/user]
public void onReceive(Context context, Intent intent) {
// TODO Auto-generated method stub
if (intent.getAction() == null)
context.startService(new Intent(context, ToggleService.class));
else
super.onReceive(context, intent);
}
[user=439709]@override[/user]
public void onUpdate(Context context, AppWidgetManager appWidgetManager,
int[] appWidgetIds) {
// TODO Auto-generated method stub
super.onUpdate(context, appWidgetManager, appWidgetIds);
}
private class ToggleService extends IntentService {
public ToggleService() {
super("AppWidget$ToggleService");
// TODO Auto-generated constructor stub
}
[user=439709]@override[/user]
protected void onHandleIntent(Intent intent) {
// TODO Auto-generated method stub
ComponentName me = new ComponentName(this, AppWidget.class);
AppWidgetManager mgr = AppWidgetManager.getInstance(this);
mgr.updateAppWidget(me, buildUpdate(this));
}
private RemoteViews buildUpdate(Context context) {
// TODO Auto-generated method stub
RemoteViews rm = new RemoteViews(context.getPackageName(),
R.layout.widget);
c++;
String s = String.valueOf(c);
rm.setTextViewText(R.id.t2, s);
Intent i = new Intent(this, AppWidget.class);
PendingIntent pi = PendingIntent.getBroadcast(context, 0, i, 0);
rm.setOnClickPendingIntent(R.id.t2, pi);
return rm;
}
}
}
THE WIDGET.XML
Code:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<TextView
android:id="@+id/t2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="0"
android:clickable="true" />
</LinearLayout>
THE WIDGET_PROVIDER.XML:
Code:
<?xml version="1.0" encoding="utf-8"?>
<appwidget-provider xmlns:android="http://schemas.android.com/apk/res/android"
android:minHeight="100sp"
android:minWidth="100sp"
android:updatePeriodMillis="1000"
android:initialLayout="@layout/widget">
</appwidget-provider>
THE MANIFEST.XML:
Code:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.increment"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="17" />
<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<activity
android:name="com.example.increment.MainActivity"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<receiver
android:name="com.example.increment.AppWidget"
android:icon="@drawable/ic_launcher"
android:label="tanmay" >
<intent-filter>
<action android:name="android.appwidget.action.APPWIDGET_UPDATE" />
</intent-filter>
<meta-data
android:name="android.appwidget.provider"
android:resource="@xml/widget_provider" />
</receiver>
<service android:name=".AppWidget$ToggleService" >
</service>
</application>
</manifest>
Thanks in advance..

2.3.3 to 4.2.2 Http Get - Help me conquer learning curve

Hey all!
New to Android but not developing. App runs great with emulator running Android 2.3.3. When I install the app to my phone (Samsung Galaxy 4S Active) runnnig Android 4.2.2, the Http Get execute command on the client does not seem to happen. I get no data back reported to my TextView.
I know there is some learning curve I'm missing here, and would appreciate some guidance.
HttpExample.java
Code:
package com.example.test;
import android.app.Activity;
import android.os.Bundle;
import android.widget.TextView;
public class HttpExample extends Activity {
TextView httpStuff;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.httpex);
httpStuff = (TextView) findViewById(R.id.tvHttp);
GetMethodEx test = new GetMethodEx();
try {
String returned = test.getInternetData();
httpStuff.setText(returned);
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}
GetMethodEx.java
Code:
package com.example.test;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.net.URI;
import org.apache.http.HttpResponse;
import org.apache.http.client.HttpClient;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.impl.client.DefaultHttpClient;
public class GetMethodEx {
public String getInternetData () throws Exception {
BufferedReader in = null;
String data = null;
try {
HttpClient client = new DefaultHttpClient();
URI website = new URI("CANTPOSTURL");
HttpGet request = new HttpGet();
request.setURI(website);
HttpResponse response = client.execute(request);
in = new BufferedReader(new InputStreamReader(response.getEntity().getContent()));
StringBuffer sb = new StringBuffer("");
String l = "";
String nl = System.getProperty("line.separator");
while ((l = in.readLine()) !=null) {
sb.append(l + nl);
}
in.close();
data = sb.toString();
return data;
}finally {
if (in !=null) {
try {
in.close();
return data;
}catch (Exception e) {
e.printStackTrace();
}
}
}
}
}
AndroidManifest.xml
Code:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="CANTPOSTURL"
package="com.example.test"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="18" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<activity
android:name="com.example.test.HttpExample"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
httpex.xml
Code:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="CANTPOSTURL"
xmlns:tools="CANTPOSTURL"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
tools:context=".HttpActivity">
<ScrollView android:layout_height="fill_parent" android:layout_width="fill_parent">
<TextView
android:id="@+id/tvHttp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Loading Data" >
</TextView>
</ScrollView>
</LinearLayout>
I would post the logcat but there really is no issue at 2.3.3... just need to know what i'm missing going to 4.2.2.
Thanks in advance, I know this should be easy for you all.

Categories

Resources