commit 8c0064a2120fd8e278c790233d95310634fe5a45
parent fd9277d2df51ff6983e5567872435362a9b0372c
Author: Jan Dankert <devnull@localhost>
Date: Tue, 7 Feb 2012 23:17:26 +0100
TapatalkExceptions nicht in RuntimeExceptions wrappen.
Diffstat:
6 files changed, 44 insertions(+), 40 deletions(-)
diff --git a/src/de/mtbnews/android/ForumActivity.java b/src/de/mtbnews/android/ForumActivity.java
@@ -399,7 +399,7 @@ public class ForumActivity extends EndlessListActivity<Topic>
@Override
protected void loadEntries(
final de.mtbnews.android.EndlessListActivity.OnListLoadedListener<Topic> onListLoaded,
- final int from, final int to, boolean firstLoad)
+ final int from, final int to, final boolean firstLoad)
{
new ServerAsyncTask(this, R.string.waitingfor_forum)
@@ -426,7 +426,10 @@ public class ForumActivity extends EndlessListActivity<Topic>
{
ForumActivity.this.setTitle(forum.getTitle());
onListLoaded.listLoaded(this.forum.getTopics());
- }
+
+ if (firstLoad)
+ Toast.makeText(ForumActivity.this, R.string.hint_press_long,
+ Toast.LENGTH_SHORT).show(); }
}.execute();
diff --git a/src/de/mtbnews/android/SubscriptionForenActivity.java b/src/de/mtbnews/android/SubscriptionForenActivity.java
@@ -95,18 +95,10 @@ public class SubscriptionForenActivity extends ListActivity
private List<Forum> newForumList;
@Override
- protected void callServer() throws IOException
+ protected void callServer() throws IOException, TapatalkException
{
-
TapatalkClient client = ((IBCApplication) getApplication()).client;
- try
- {
- newForumList = client.getSubscribedForum(false);
- }
- catch (TapatalkException e)
- {
- throw new RuntimeException(e);
- }
+ newForumList = client.getSubscribedForum(false);
}
protected void doOnSuccess()
diff --git a/src/de/mtbnews/android/SubscriptionTopicsActivity.java b/src/de/mtbnews/android/SubscriptionTopicsActivity.java
@@ -42,8 +42,8 @@ public class SubscriptionTopicsActivity extends EndlessListActivity<Topic>
setContentView(R.layout.listing);
- ListAdapter adapter = new ListEntryContentAdapter(SubscriptionTopicsActivity.this,
- entries);
+ ListAdapter adapter = new ListEntryContentAdapter(
+ SubscriptionTopicsActivity.this, entries);
setListAdapter(adapter);
initialLoad();
@@ -68,18 +68,17 @@ public class SubscriptionTopicsActivity extends EndlessListActivity<Topic>
int position, long id)
{
// int aktPosition = displayFrom + position + 1;
- final Intent intent = new Intent(SubscriptionTopicsActivity.this,
- TopicActivity.class);
- Topic topic = SubscriptionTopicsActivity.super.entries.get(position);
+ final Intent intent = new Intent(
+ SubscriptionTopicsActivity.this, TopicActivity.class);
+ Topic topic = SubscriptionTopicsActivity.super.entries
+ .get(position);
intent.putExtra(TopicActivity.TOPIC_ID, topic.getId());
startActivity(intent);
}
});
-
- Toast.makeText(this, R.string.hint_press_long, Toast.LENGTH_SHORT)
- .show();
}
+
@Override
public boolean onContextItemSelected(MenuItem item)
{
@@ -92,8 +91,8 @@ public class SubscriptionTopicsActivity extends EndlessListActivity<Topic>
final Intent intent = new Intent(
SubscriptionTopicsActivity.this, TopicActivity.class);
- intent.putExtra(TopicActivity.TOPIC_ID, super.entries.get(menuInfo.position)
- .getId());
+ intent.putExtra(TopicActivity.TOPIC_ID, super.entries.get(
+ menuInfo.position).getId());
intent.putExtra(EndlessListActivity.FIRST_POST, true);
startActivity(intent);
return true;
@@ -102,8 +101,8 @@ public class SubscriptionTopicsActivity extends EndlessListActivity<Topic>
final Intent intent2 = new Intent(
SubscriptionTopicsActivity.this, TopicActivity.class);
- intent2.putExtra(TopicActivity.TOPIC_ID, super.entries.get(menuInfo.position)
- .getId());
+ intent2.putExtra(TopicActivity.TOPIC_ID, super.entries.get(
+ menuInfo.position).getId());
intent2.putExtra(EndlessListActivity.LAST_POST, true);
startActivity(intent2);
return true;
@@ -111,6 +110,7 @@ public class SubscriptionTopicsActivity extends EndlessListActivity<Topic>
return super.onContextItemSelected(item);
}
+
@Override
protected int getTotalSize()
{
@@ -120,7 +120,7 @@ public class SubscriptionTopicsActivity extends EndlessListActivity<Topic>
@Override
protected void loadEntries(
final OnListLoadedListener<Topic> onListLoadedListener,
- final int from, final int to, boolean firstLoad)
+ final int from, final int to, final boolean firstLoad)
{
new ServerAsyncTask(SubscriptionTopicsActivity.this,
firstLoad ? R.string.waitingfor_subscription_topics
@@ -129,26 +129,25 @@ public class SubscriptionTopicsActivity extends EndlessListActivity<Topic>
private ListHolder<Topic> topicHolder;
@Override
- protected void callServer() throws IOException
+ protected void callServer() throws IOException, TapatalkException
{
TapatalkClient client = ((IBCApplication) getApplication()).client;
- try
- {
- topicHolder = client.getSubscribedTopics(from, to,false);
+ topicHolder = client.getSubscribedTopics(from, to, false);
- totalSize = topicHolder.totalCount;
- }
- catch (TapatalkException e)
- {
- throw new RuntimeException(e);
- }
+ totalSize = topicHolder.totalCount;
}
protected void doOnSuccess()
{
- //SubscriptionTopicsActivity.this.setTitle(topicHolder.getTitle());
+ // SubscriptionTopicsActivity.this.setTitle(topicHolder.getTitle());
onListLoadedListener.listLoaded(this.topicHolder.getChildren());
+
+ if (firstLoad)
+ Toast.makeText(SubscriptionTopicsActivity.this,
+ R.string.hint_press_long, Toast.LENGTH_SHORT)
+ .show();
+
}
}.execute();
diff --git a/src/de/mtbnews/android/TopicActivity.java b/src/de/mtbnews/android/TopicActivity.java
@@ -76,9 +76,6 @@ public class TopicActivity extends EndlessListActivity<Post>
// startActivity(intent);
}
});
-
- Toast.makeText(this, R.string.hint_press_long, Toast.LENGTH_SHORT)
- .show();
}
@Override
diff --git a/src/de/mtbnews/android/util/IBC.java b/src/de/mtbnews/android/util/IBC.java
@@ -23,10 +23,15 @@ public interface IBC
* Fee-URL für Nachrichten.
*/
static final String IBC_NEWS_RSS_URL = "http://www.mtb-news.de/news/feed/";
-
+
/**
* Feed-URL für Fotos.
*/
static final String IBC_FOTOS_RSS_URL = "http://fotos.mtb-news.de/photos/recent.rss";
+ /**
+ * Logging-Tag.
+ */
+ static final String TAG = "IBC";
+
}
diff --git a/src/org/xmlrpc/android/XMLRPCClient.java b/src/org/xmlrpc/android/XMLRPCClient.java
@@ -34,6 +34,8 @@ import org.apache.http.protocol.HttpContext;
import org.xmlpull.v1.XmlPullParser;
import org.xmlpull.v1.XmlPullParserFactory;
+import de.mtbnews.android.util.IBC;
+
import android.util.Log;
/**
@@ -138,6 +140,12 @@ public class XMLRPCClient extends XMLRPCCommon
public CookieStore cookieStore = new BasicCookieStore();
HttpContext localContext = new BasicHttpContext();
+ @Override
+ protected void finalize() throws Throwable
+ {
+ Log.w(IBC.TAG,"*********** destructing the XMLRPC client ************");
+ super.finalize();
+ }
/**
* XMLRPCClient constructor. Creates new instance based on server URI (Code
* contributed by sgayda2 from issue #17, and by erickok from ticket #10)