Added a legal information that can be view by the user

Signed-off-by: Ricky Barrette <rickbarrette@gmail.com>
This commit is contained in:
2012-09-16 11:55:49 -04:00
parent fc86aa6fa7
commit 2d80b371a6
8 changed files with 258 additions and 4 deletions

View File

@@ -25,6 +25,9 @@ import android.content.Intent;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentActivity;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import com.TwentyCodes.android.exception.ExceptionHandler;
@@ -49,6 +52,13 @@ public class ForumListActivity extends FragmentActivity implements OnItemSelecte
}
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
final MenuInflater inflater = getMenuInflater();
inflater.inflate(R.menu.main_menu, menu);
return super.onCreateOptionsMenu(menu);
}
@Override
public void onItemSelected(final Fragment listFragment, final String id) {
if(listFragment instanceof ForumDetailFragment){
@@ -70,5 +80,15 @@ public class ForumListActivity extends FragmentActivity implements OnItemSelecte
detailIntent.putExtra(ForumDetailFragment.ARG_ITEM_ID, id);
startActivity(detailIntent);
}
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
switch(item.getItemId()){
case R.id.legal:
startActivity(new Intent(this, LegalActivity.class));
return true;
}
return super.onOptionsItemSelected(item);
}
}

View File

@@ -0,0 +1,40 @@
/**
* LegalActivity.java
* @date Sep 16, 2012
* @author ricky barrette
*
* Copyright 2012 Richard Barrette
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License
*/
package org.RickBarrette.osj.forum;
import android.app.Activity;
import android.os.Bundle;
import android.webkit.WebView;
/**
* This is a super simple web activity to display legal information to the user
* @author ricky barrette
*/
public class LegalActivity extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.leagal_activity);
WebView wv = (WebView) findViewById(R.id.webview);
wv.loadUrl("file:///android_asset/legal.html");
}
}

View File

@@ -1,12 +1,10 @@
package org.xmlrpc.android;
import java.io.BufferedReader;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.io.Reader;
import java.io.StringWriter;
import java.net.Socket;