From 74c83a339136722870290004b916554c7de03b11 Mon Sep 17 00:00:00 2001 From: Equip de Desenvolupadors de PBE Date: Sun, 9 Dec 2012 18:34:01 +0000 Subject: [PATCH] update url --- gen/com/upc/pbe/upcnews/R.java | 192 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++------------------------------------------------------------------------------------------------ src/com/upc/pbe/upcnews/MainActivity.java | 24 +++++++++++++++++------- src/com/upc/pbe/upcnews/UpcApp.java | 1 - 3 files changed, 113 insertions(+), 104 deletions(-) diff --git a/gen/com/upc/pbe/upcnews/R.java b/gen/com/upc/pbe/upcnews/R.java index a525c7d..b07f5e1 100644 --- a/gen/com/upc/pbe/upcnews/R.java +++ b/gen/com/upc/pbe/upcnews/R.java @@ -1,96 +1,96 @@ -/* AUTO-GENERATED FILE. DO NOT MODIFY. - * - * This class was automatically generated by the - * aapt tool from the resource data it found. It - * should not be modified by hand. - */ - -package com.upc.pbe.upcnews; - -public final class R { - public static final class attr { - } - public static final class color { - public static final int Black=0x7f050002; - public static final int Blue=0x7f050004; - public static final int BlueAndroid=0x7f050005; - public static final int Gay=0x7f050007; - public static final int Gray=0x7f05000a; - public static final int Green=0x7f050009; - public static final int Orange=0x7f050003; - public static final int Red=0x7f050008; - public static final int White=0x7f050006; - public static final int Whyte_POwaH=0x7f050001; - public static final int backgroundmain=0x7f050000; - } - public static final class dimen { - public static final int TitleSize=0x7f060000; - public static final int lesize=0x7f060001; - } - public static final class drawable { - public static final int ic_action_search=0x7f020000; - public static final int ic_launcher=0x7f020001; - public static final int ic_ledarklogo=0x7f020002; - public static final int ic_menu_name=0x7f020003; - public static final int ic_startbutton=0x7f020004; - public static final int selectedonlist=0x7f020005; - public static final int selectedonlist2=0x7f020006; - public static final int startbuttontoggle=0x7f020007; - } - public static final class id { - public static final int LinearLayout1=0x7f0a0001; - public static final int RelativeLayout1=0x7f0a0006; - public static final int button=0x7f0a0007; - public static final int itemhelp=0x7f0a000d; - public static final int itemprefs=0x7f0a000c; - public static final int listView1=0x7f0a0003; - public static final int menu_settings=0x7f0a000b; - public static final int rowTextView=0x7f0a000a; - public static final int textView1=0x7f0a0004; - public static final int textView2=0x7f0a0005; - public static final int textViewTitle=0x7f0a0002; - public static final int textViewUrl=0x7f0a0009; - public static final int textViewXml=0x7f0a0008; - public static final int videoView1=0x7f0a0000; - } - public static final class layout { - public static final int activity_video=0x7f030000; - public static final int dirs=0x7f030001; - public static final int help=0x7f030002; - public static final int main_activity=0x7f030003; - public static final int rowlayout=0x7f030004; - } - public static final class menu { - public static final int activity_main=0x7f090000; - public static final int activity_video=0x7f090001; - public static final int menu=0x7f090002; - } - public static final class string { - public static final int app_name=0x7f070000; - public static final int button=0x7f07000c; - public static final int button1=0x7f07000d; - public static final int defaultURL=0x7f070012; - public static final int desc=0x7f070009; - public static final int descarregar=0x7f070003; - public static final int dir=0x7f07000a; - public static final int directoris=0x7f07000b; - public static final int hello_world=0x7f070010; - public static final int help=0x7f070008; - public static final int hint=0x7f070004; - public static final int menu_settings=0x7f070001; - public static final int prefs=0x7f070007; - public static final int startbuttondescription=0x7f07000f; - public static final int title=0x7f07000e; - public static final int title_activity_main=0x7f070002; - public static final int title_activity_video=0x7f070011; - public static final int url=0x7f070005; - public static final int urlhint=0x7f070006; - } - public static final class style { - public static final int AppTheme=0x7f080000; - public static final int leBoldText=0x7f080001; - } - public static final class xml { - public static final int prefs=0x7f040000; - } -} +/* AUTO-GENERATED FILE. DO NOT MODIFY. + * + * This class was automatically generated by the + * aapt tool from the resource data it found. It + * should not be modified by hand. + */ + +package com.upc.pbe.upcnews; + +public final class R { + public static final class attr { + } + public static final class color { + public static final int Black=0x7f050002; + public static final int Blue=0x7f050004; + public static final int BlueAndroid=0x7f050005; + public static final int Gay=0x7f050007; + public static final int Gray=0x7f05000a; + public static final int Green=0x7f050009; + public static final int Orange=0x7f050003; + public static final int Red=0x7f050008; + public static final int White=0x7f050006; + public static final int Whyte_POwaH=0x7f050001; + public static final int backgroundmain=0x7f050000; + } + public static final class dimen { + public static final int TitleSize=0x7f060000; + public static final int lesize=0x7f060001; + } + public static final class drawable { + public static final int ic_action_search=0x7f020000; + public static final int ic_launcher=0x7f020001; + public static final int ic_ledarklogo=0x7f020002; + public static final int ic_menu_name=0x7f020003; + public static final int ic_startbutton=0x7f020004; + public static final int selectedonlist=0x7f020005; + public static final int selectedonlist2=0x7f020006; + public static final int startbuttontoggle=0x7f020007; + } + public static final class id { + public static final int LinearLayout1=0x7f0a0001; + public static final int RelativeLayout1=0x7f0a0006; + public static final int button=0x7f0a0007; + public static final int itemhelp=0x7f0a000d; + public static final int itemprefs=0x7f0a000c; + public static final int listView1=0x7f0a0003; + public static final int menu_settings=0x7f0a000b; + public static final int rowTextView=0x7f0a000a; + public static final int textView1=0x7f0a0004; + public static final int textView2=0x7f0a0005; + public static final int textViewTitle=0x7f0a0002; + public static final int textViewUrl=0x7f0a0009; + public static final int textViewXml=0x7f0a0008; + public static final int videoView1=0x7f0a0000; + } + public static final class layout { + public static final int activity_video=0x7f030000; + public static final int dirs=0x7f030001; + public static final int help=0x7f030002; + public static final int main_activity=0x7f030003; + public static final int rowlayout=0x7f030004; + } + public static final class menu { + public static final int activity_main=0x7f090000; + public static final int activity_video=0x7f090001; + public static final int menu=0x7f090002; + } + public static final class string { + public static final int app_name=0x7f070000; + public static final int button=0x7f07000c; + public static final int button1=0x7f07000d; + public static final int defaultURL=0x7f070012; + public static final int desc=0x7f070009; + public static final int descarregar=0x7f070003; + public static final int dir=0x7f07000a; + public static final int directoris=0x7f07000b; + public static final int hello_world=0x7f070010; + public static final int help=0x7f070008; + public static final int hint=0x7f070004; + public static final int menu_settings=0x7f070001; + public static final int prefs=0x7f070007; + public static final int startbuttondescription=0x7f07000f; + public static final int title=0x7f07000e; + public static final int title_activity_main=0x7f070002; + public static final int title_activity_video=0x7f070011; + public static final int url=0x7f070005; + public static final int urlhint=0x7f070006; + } + public static final class style { + public static final int AppTheme=0x7f080000; + public static final int leBoldText=0x7f080001; + } + public static final class xml { + public static final int prefs=0x7f040000; + } +} diff --git a/src/com/upc/pbe/upcnews/MainActivity.java b/src/com/upc/pbe/upcnews/MainActivity.java index 7651947..41440d0 100644 --- a/src/com/upc/pbe/upcnews/MainActivity.java +++ b/src/com/upc/pbe/upcnews/MainActivity.java @@ -1,6 +1,7 @@ package com.upc.pbe.upcnews; import java.io.File; + import android.app.Activity; import android.content.Intent; import android.os.Bundle; @@ -10,12 +11,14 @@ import android.view.MenuItem; import android.view.View; import android.view.View.OnClickListener; import android.widget.ImageButton; +import android.widget.TextView; import android.widget.Toast; public class MainActivity extends Activity implements OnClickListener { private final static String TAG = "Main"; private static String html; private ImageButton buttonDescarrega; + private TextView URLText; @Override @@ -29,9 +32,21 @@ public class MainActivity extends Activity implements OnClickListener { { Log.d(TAG,"Directory " + tempFolder.toString() + " created"); } + URLText = (TextView) findViewById(R.id.textViewUrl); buttonDescarrega = (ImageButton) findViewById(R.id.button); buttonDescarrega.setOnClickListener(this); - this.getUrl(); + updateURL(); + } + + public void onResume() + { + super.onResume(); + updateURL(); + } + + public void updateURL() + { + URLText.setText(((UpcApp)getApplication()).getPrefs().getString("server", null)); } public boolean onCreateOptionsMenu(Menu menu) { @@ -40,11 +55,6 @@ public class MainActivity extends Activity implements OnClickListener { return true; } - public String getUrl() { - String u = ((UpcApp) getApplication()).getUrl(); - return u; - } - public void onClick(View v) { Log.d(TAG, "onClicked"); this.descarregar(); @@ -55,7 +65,7 @@ public class MainActivity extends Activity implements OnClickListener { public void descarregar() { Descarrega d = new Descarrega(); Toast.makeText(this, "Download succesfull", Toast.LENGTH_LONG).show(); - html = (String) d.doInBackground(this.getUrl()); + html = (String) d.doInBackground(((UpcApp)getApplication()).getUrl()); } public boolean onOptionsItemSelected(MenuItem item) { diff --git a/src/com/upc/pbe/upcnews/UpcApp.java b/src/com/upc/pbe/upcnews/UpcApp.java index 89c32f1..8104535 100644 --- a/src/com/upc/pbe/upcnews/UpcApp.java +++ b/src/com/upc/pbe/upcnews/UpcApp.java @@ -46,7 +46,6 @@ public class UpcApp extends Application implements OnSharedPreferenceChangeListe public void onSharedPreferenceChanged(SharedPreferences arg0, String key) { - Log.d(TAG, "onSharedPreferenceChanged for key: " + key); } -- libgit2 0.22.2