@ -12,19 +12,16 @@ import java.util.HashMap;
import java.util.List ;
import java.util.List ;
import java.util.Map ;
import java.util.Map ;
import android.annotation.SuppressLint ;
import android.app.Activity ;
import android.app.Activity ;
import android.app.AlertDialog ;
import android.app.AlertDialog ;
import android.app.DownloadManager ;
import android.app.DownloadManager ;
import android.content.ActivityNotFoundException ;
import android.content.ClipData ;
import android.content.ClipData ;
import android.content.ClipboardManager ;
import android.content.ClipboardManager ;
import android.content.ComponentName ;
import android.content.Context ;
import android.content.Context ;
import android.content.DialogInterface ;
import android.content.DialogInterface ;
import android.content.Intent ;
import android.content.Intent ;
import android.content.SharedPreferences ;
import android.content.SharedPreferences ;
import android.content.pm.PackageManager ;
import android.content.pm.ResolveInfo ;
import android.content.res.Configuration ;
import android.content.res.Configuration ;
import android.database.Cursor ;
import android.database.Cursor ;
import android.database.DatabaseUtils ;
import android.database.DatabaseUtils ;
@ -67,19 +64,15 @@ import android.view.animation.Animation.AnimationListener;
import android.view.animation.AnimationUtils ;
import android.view.animation.AnimationUtils ;
import android.view.inputmethod.EditorInfo ;
import android.view.inputmethod.EditorInfo ;
import android.view.inputmethod.InputMethodManager ;
import android.view.inputmethod.InputMethodManager ;
import android.webkit.ConsoleMessage ;
import android.webkit.DownloadListener ;
import android.webkit.DownloadListener ;
import android.webkit.GeolocationPermissions ;
import android.webkit.GeolocationPermissions ;
import android.webkit.HttpAuthHandler ;
import android.webkit.HttpAuthHandler ;
import android.webkit.JsPromptResult ;
import android.webkit.JsResult ;
import android.webkit.SslErrorHandler ;
import android.webkit.SslErrorHandler ;
import android.webkit.URLUtil ;
import android.webkit.URLUtil ;
import android.webkit.ValueCallback ;
import android.webkit.ValueCallback ;
import android.webkit.WebChromeClient ;
import android.webkit.WebChromeClient ;
import android.webkit.WebChromeClient.CustomViewCallback ;
import android.webkit.WebChromeClient.CustomViewCallback ;
import android.webkit.WebIconDatabase ;
import android.webkit.WebIconDatabase ;
import android.webkit.WebResourceResponse ;
import android.webkit.WebSettings ;
import android.webkit.WebSettings ;
import android.webkit.WebSettings.LayoutAlgorithm ;
import android.webkit.WebSettings.LayoutAlgorithm ;
import android.webkit.WebSettings.PluginState ;
import android.webkit.WebSettings.PluginState ;
@ -114,7 +107,6 @@ public class Barebones extends Activity {
static final boolean PAID_VERSION = false ;
static final boolean PAID_VERSION = false ;
// variable declaration
// variable declaration
static Rect edge ;
static Rect edge ;
static SimpleAdapter adapter ;
static SimpleAdapter adapter ;
static MultiAutoCompleteTextView getUrl ;
static MultiAutoCompleteTextView getUrl ;
@ -145,7 +137,7 @@ public class Barebones extends Activity {
static boolean xPress ;
static boolean xPress ;
static boolean tabsAreDisplayed = true , isPhone = false ;
static boolean tabsAreDisplayed = true , isPhone = false ;
static boolean pageIsLoading = false , java ;
static boolean pageIsLoading = false , java ;
static boolean allowLocation , savePasswords , deleteHistory ;
static boolean allowLocation , savePasswords , deleteHistory , saveTabs ;
static boolean showFullScreen , pageIdIsVisible = true ;
static boolean showFullScreen , pageIdIsVisible = true ;
static boolean urlBarShows = true , move = false ;
static boolean urlBarShows = true , move = false ;
static boolean isBookmarkShowing = false ;
static boolean isBookmarkShowing = false ;
@ -155,6 +147,7 @@ public class Barebones extends Activity {
static SharedPreferences . Editor edit ;
static SharedPreferences . Editor edit ;
static String desktop , mobile , user ;
static String desktop , mobile , user ;
static String urlA , title ;
static String urlA , title ;
static String [ ] memoryURL = new String [ MAX_TABS ] ;
static final String [ ] bUrl = new String [ MAX_BOOKMARKS ] ;
static final String [ ] bUrl = new String [ MAX_BOOKMARKS ] ;
static final String [ ] bTitle = new String [ MAX_BOOKMARKS ] ;
static final String [ ] bTitle = new String [ MAX_BOOKMARKS ] ;
static String [ ] columns ;
static String [ ] columns ;
@ -195,7 +188,15 @@ public class Barebones extends Activity {
super . onCreate ( savedInstanceState ) ;
super . onCreate ( savedInstanceState ) ;
setContentView ( R . layout . activity_main ) ; // displays main xml layout
setContentView ( R . layout . activity_main ) ; // displays main xml layout
settings = getSharedPreferences ( preferences , 0 ) ;
settings = getSharedPreferences ( preferences , 0 ) ;
edit = settings . edit ( ) ;
edit = settings . edit ( ) ;
saveTabs = settings . getBoolean ( "savetabs" , true ) ;
if ( saveTabs ) {
String mem = settings . getString ( "memory" , "" ) ;
memoryURL = null ;
memoryURL = GetArray ( mem , "\\|\\$\\|SEPARATOR\\|\\$\\|" ) ;
}
inactive = this . getResources ( ) . getDrawable ( R . drawable . bg_inactive ) ;
inactive = this . getResources ( ) . getDrawable ( R . drawable . bg_inactive ) ;
active = this . getResources ( ) . getDrawable ( R . drawable . bg_press ) ;
active = this . getResources ( ) . getDrawable ( R . drawable . bg_press ) ;
init ( ) ; // sets up random stuff
init ( ) ; // sets up random stuff
@ -241,10 +242,12 @@ public class Barebones extends Activity {
}
}
}
}
@SuppressLint ( "InlinedApi" )
public void init ( ) {
public void init ( ) {
DisplayMetrics metrics = new DisplayMetrics ( ) ;
DisplayMetrics metrics = new DisplayMetrics ( ) ;
getWindowManager ( ) . getDefaultDisplay ( ) . getMetrics ( metrics ) ;
getWindowManager ( ) . getDefaultDisplay ( ) . getMetrics ( metrics ) ;
historyHandler = new DatabaseHandler ( this ) ;
historyHandler = new DatabaseHandler ( this ) ;
API = Integer . valueOf ( android . os . Build . VERSION . SDK_INT ) ; // gets the sdk
API = Integer . valueOf ( android . os . Build . VERSION . SDK_INT ) ; // gets the sdk
// level
// level
progressBar = ( ProgressBar ) findViewById ( R . id . progressBar1 ) ;
progressBar = ( ProgressBar ) findViewById ( R . id . progressBar1 ) ;
@ -255,6 +258,7 @@ public class Barebones extends Activity {
progressBar . setIndeterminateDrawable ( getResources ( ) . getDrawable (
progressBar . setIndeterminateDrawable ( getResources ( ) . getDrawable (
R . drawable . ginger_animation ) ) ;
R . drawable . ginger_animation ) ) ;
}
}
showFullScreen = settings . getBoolean ( "fullscreen" , false ) ;
showFullScreen = settings . getBoolean ( "fullscreen" , false ) ;
uBar = ( RelativeLayout ) findViewById ( R . id . urlBar ) ;
uBar = ( RelativeLayout ) findViewById ( R . id . urlBar ) ;
bg = ( RelativeLayout ) findViewById ( R . id . background ) ;
bg = ( RelativeLayout ) findViewById ( R . id . background ) ;
@ -311,6 +315,7 @@ public class Barebones extends Activity {
// user agent
// user agent
user = test . getSettings ( ) . getUserAgentString ( ) ;
user = test . getSettings ( ) . getUserAgentString ( ) ;
background = ( FrameLayout ) findViewById ( R . id . holder ) ;
background = ( FrameLayout ) findViewById ( R . id . holder ) ;
mobile = user ; // setting mobile user
mobile = user ; // setting mobile user
// agent
// agent
@ -398,13 +403,46 @@ public class Barebones extends Activity {
String URL = null ; // that opens the browser
String URL = null ; // that opens the browser
// gets the string passed into the browser
// gets the string passed into the browser
URL = url . getDataString ( ) ;
URL = url . getDataString ( ) ;
if ( URL ! = null ) {
boolean oldTabs = false ;
// opens a new tab with the url if its there
newTab ( number , URL , true ) ;
if ( saveTabs ) {
if ( URL ! = null ) {
// opens a new tab with the url if its there
newTab ( number , URL , true ) ;
main [ 0 ] . resumeTimers ( ) ;
oldTabs = true ;
}
for ( int num = 0 ; num < memoryURL . length ; num + + ) {
if ( memoryURL [ num ] . length ( ) > 0 ) {
if ( number = = 0 ) {
newTab ( number , memoryURL [ num ] , ! oldTabs ) ;
main [ 0 ] . resumeTimers ( ) ;
} else {
newTab ( number , memoryURL [ num ] , false ) ;
}
oldTabs = true ;
}
}
if ( ! oldTabs ) {
newTab ( number , homepage , true ) ;
}
} else {
} else {
// otherwise it opens the homepage
if ( URL ! = null ) {
newTab ( number , homepage , true ) ;
// opens a new tab with the url if its there
newTab ( number , URL , true ) ;
main [ 0 ] . resumeTimers ( ) ;
} else {
// otherwise it opens the homepage
newTab ( number , homepage , true ) ;
main [ 0 ] . resumeTimers ( ) ;
}
}
}
main [ 0 ] . resumeTimers ( ) ;
// new tab button
// new tab button
ImageView newTab = ( ImageView ) findViewById ( R . id . newTab ) ;
ImageView newTab = ( ImageView ) findViewById ( R . id . newTab ) ;
@ -493,6 +531,7 @@ public class Barebones extends Activity {
}
}
}
}
@SuppressLint ( "HandlerLeak" )
public void enterUrl ( ) {
public void enterUrl ( ) {
getUrl = ( MultiAutoCompleteTextView ) findViewById ( R . id . enterUrl ) ;
getUrl = ( MultiAutoCompleteTextView ) findViewById ( R . id . enterUrl ) ;
getUrl . setPadding ( tenPad , 0 , tenPad , 0 ) ;
getUrl . setPadding ( tenPad , 0 , tenPad , 0 ) ;
@ -534,6 +573,7 @@ public class Barebones extends Activity {
c = getContentResolver ( ) . query ( bookmarks , columns , null ,
c = getContentResolver ( ) . query ( bookmarks , columns , null ,
null , null ) ;
null , null ) ;
} catch ( SQLiteException e ) {
} catch ( SQLiteException e ) {
} catch ( IllegalStateException e ) {
}
}
noStockBrowser = true ;
noStockBrowser = true ;
if ( c ! = null ) {
if ( c ! = null ) {
@ -627,6 +667,7 @@ public class Barebones extends Activity {
}
}
// new tab method, takes the id of the tab to be created and the url to load
// new tab method, takes the id of the tab to be created and the url to load
@SuppressWarnings ( "deprecation" )
public void newTab ( int theId , final String theUrl , final boolean display ) {
public void newTab ( int theId , final String theUrl , final boolean display ) {
lastVisibleWebView = pageId ;
lastVisibleWebView = pageId ;
if ( isBookmarkShowing ) {
if ( isBookmarkShowing ) {
@ -773,6 +814,7 @@ public class Barebones extends Activity {
public class TabTouch implements OnTouchListener {
public class TabTouch implements OnTouchListener {
@SuppressWarnings ( "deprecation" )
@Override
@Override
public boolean onTouch ( View v , MotionEvent event ) {
public boolean onTouch ( View v , MotionEvent event ) {
pageIdIsVisible = false ;
pageIdIsVisible = false ;
@ -877,6 +919,7 @@ public class Barebones extends Activity {
public class TabClick implements OnClickListener {
public class TabClick implements OnClickListener {
@SuppressWarnings ( "deprecation" )
@Override
@Override
public void onClick ( View v ) {
public void onClick ( View v ) {
id = v . getId ( ) ;
id = v . getId ( ) ;
@ -1026,6 +1069,7 @@ public class Barebones extends Activity {
try {
try {
Thread down = new Thread (
Thread down = new Thread (
new Runnable ( ) {
new Runnable ( ) {
@SuppressLint ( "InlinedApi" )
@Override
@Override
public void run ( ) {
public void run ( ) {
@ -1065,6 +1109,8 @@ public class Barebones extends Activity {
Toast . makeText ( Barebones . this ,
Toast . makeText ( Barebones . this ,
"Error Downloading File" ,
"Error Downloading File" ,
Toast . LENGTH_SHORT ) . show ( ) ;
Toast . LENGTH_SHORT ) . show ( ) ;
} catch ( SecurityException e ) {
}
}
}
}
break ;
break ;
@ -1086,6 +1132,7 @@ public class Barebones extends Activity {
} else {
} else {
DialogInterface . OnClickListener dialogClickListener = new DialogInterface . OnClickListener ( ) {
DialogInterface . OnClickListener dialogClickListener = new DialogInterface . OnClickListener ( ) {
@SuppressWarnings ( "deprecation" )
@Override
@Override
public void onClick ( DialogInterface dialog , int which ) {
public void onClick ( DialogInterface dialog , int which ) {
switch ( which ) {
switch ( which ) {
@ -1138,19 +1185,6 @@ public class Barebones extends Activity {
public class AnthonyWebViewClient extends WebViewClient {
public class AnthonyWebViewClient extends WebViewClient {
@Override
public void onFormResubmission ( WebView view , Message dontResend ,
Message resend ) {
// TODO Auto-generated method stub
super . onFormResubmission ( view , dontResend , resend ) ;
}
@Override
public void onLoadResource ( WebView view , String url ) {
// TODO Auto-generated method stub
super . onLoadResource ( view , url ) ;
}
@Override
@Override
public void onScaleChanged ( WebView view , float oldScale , float newScale ) {
public void onScaleChanged ( WebView view , float oldScale , float newScale ) {
// TODO Auto-generated method stub
// TODO Auto-generated method stub
@ -1160,25 +1194,6 @@ public class Barebones extends Activity {
super . onScaleChanged ( view , oldScale , newScale ) ;
super . onScaleChanged ( view , oldScale , newScale ) ;
}
}
@Override
public void onUnhandledKeyEvent ( WebView view , KeyEvent event ) {
// TODO Auto-generated method stub
super . onUnhandledKeyEvent ( view , event ) ;
}
@Override
public WebResourceResponse shouldInterceptRequest ( WebView view ,
String url ) {
// TODO Auto-generated method stub
return super . shouldInterceptRequest ( view , url ) ;
}
@Override
public boolean shouldOverrideKeyEvent ( WebView view , KeyEvent event ) {
// TODO Auto-generated method stub
return super . shouldOverrideKeyEvent ( view , event ) ;
}
@Override
@Override
public void doUpdateVisitedHistory ( WebView view , final String url ,
public void doUpdateVisitedHistory ( WebView view , final String url ,
final boolean isReload ) {
final boolean isReload ) {
@ -1196,12 +1211,6 @@ public class Barebones extends Activity {
return ;
return ;
}
}
@Override
public boolean shouldOverrideUrlLoading ( WebView view , String url ) {
return super . shouldOverrideUrlLoading ( view , url ) ;
}
@Override
@Override
public void onReceivedHttpAuthRequest ( WebView view ,
public void onReceivedHttpAuthRequest ( WebView view ,
HttpAuthHandler handler , String host , String realm ) {
HttpAuthHandler handler , String host , String realm ) {
@ -1209,13 +1218,6 @@ public class Barebones extends Activity {
super . onReceivedHttpAuthRequest ( view , handler , host , realm ) ;
super . onReceivedHttpAuthRequest ( view , handler , host , realm ) ;
}
}
@Override
public void onReceivedError ( WebView view , int errorCode ,
String description , String failingUrl ) {
super . onReceivedError ( view , errorCode , description , failingUrl ) ;
}
@Override
@Override
public void onReceivedSslError ( WebView view , SslErrorHandler handler ,
public void onReceivedSslError ( WebView view , SslErrorHandler handler ,
SslError error ) {
SslError error ) {
@ -1235,9 +1237,11 @@ public class Barebones extends Activity {
public void onPageStarted ( WebView view , String url , Bitmap favicon ) {
public void onPageStarted ( WebView view , String url , Bitmap favicon ) {
numberPage = view . getId ( ) ;
numberPage = view . getId ( ) ;
pageIsLoading = true ;
pageIsLoading = true ;
getUrl . setText ( url ) ;
refresh . setVisibility ( View . INVISIBLE ) ;
refresh . setVisibility ( View . INVISIBLE ) ;
progressBar . setVisibility ( View . VISIBLE ) ;
progressBar . setVisibility ( View . VISIBLE ) ;
if ( main [ numberPage ] . isShown ( ) ) {
getUrl . setText ( url ) ;
}
getUrl . setPadding ( tenPad , 0 , tenPad , 0 ) ;
getUrl . setPadding ( tenPad , 0 , tenPad , 0 ) ;
urlToLoad [ numberPage ] [ 0 ] = url ;
urlToLoad [ numberPage ] [ 0 ] = url ;
urlTitle [ numberPage ] . setCompoundDrawables ( webpageOther , null ,
urlTitle [ numberPage ] . setCompoundDrawables ( webpageOther , null ,
@ -1264,32 +1268,11 @@ public class Barebones extends Activity {
public void onDownloadStart ( final String url , String userAgent ,
public void onDownloadStart ( final String url , String userAgent ,
final String contentDisposition , final String mimetype ,
final String contentDisposition , final String mimetype ,
long contentLength ) {
long contentLength ) {
/ *
* if ( contentDisposition = = null | |
* ! contentDisposition . regionMatches ( true , 0 , "attachment" , 0 , 10 ) )
* { // query the package manager to see if there's a registered //
* handler // that matches. Intent intent = new
* Intent ( Intent . ACTION_VIEW ) ; intent . setDataAndType ( Uri . parse ( url ) ,
* mimetype ) ; intent . addFlags ( Intent . FLAG_ACTIVITY_NEW_TASK ) ;
* ResolveInfo info = getPackageManager ( ) . resolveActivity ( intent ,
* PackageManager . MATCH_DEFAULT_ONLY ) ; if ( info ! = null ) {
* ComponentName myName = getComponentName ( ) ; // If we resolved to
* ourselves , we don ' t want to attempt to // load the url only to
* try and download it again . if ( ! myName . getPackageName ( ) . equals (
* info . activityInfo . packageName ) | | ! myName . getClassName ( ) . equals (
* info . activityInfo . name ) ) { // someone (other than us) knows how
* to handle this mime // type with this scheme, don't download. try
* { startActivity ( intent ) ; return ; } catch
* ( ActivityNotFoundException ex ) {
*
* // Best behavior is to fall back to a download in // this // case
* } } } } else {
* /
try {
try {
Thread downloader = new Thread ( new Runnable ( ) {
Thread downloader = new Thread ( new Runnable ( ) {
@SuppressLint ( "InlinedApi" )
@Override
@Override
public void run ( ) {
public void run ( ) {
DownloadManager download = ( DownloadManager ) getSystemService ( DOWNLOAD_SERVICE ) ;
DownloadManager download = ( DownloadManager ) getSystemService ( DOWNLOAD_SERVICE ) ;
Uri nice = Uri . parse ( url ) ;
Uri nice = Uri . parse ( url ) ;
DownloadManager . Request it = new DownloadManager . Request (
DownloadManager . Request it = new DownloadManager . Request (
@ -1317,6 +1300,8 @@ public class Barebones extends Activity {
Log . e ( "Barebones" , "Problem downloading" ) ;
Log . e ( "Barebones" , "Problem downloading" ) ;
Toast . makeText ( Barebones . this , "Error Downloading File" ,
Toast . makeText ( Barebones . this , "Error Downloading File" ,
Toast . LENGTH_SHORT ) . show ( ) ;
Toast . LENGTH_SHORT ) . show ( ) ;
} catch ( SecurityException e ) {
}
}
}
}
@ -1338,28 +1323,17 @@ public class Barebones extends Activity {
}
}
}
}
@SuppressLint ( "SetJavaScriptEnabled" )
public class AnthonyChromeClient extends WebChromeClient {
public class AnthonyChromeClient extends WebChromeClient {
private Bitmap mDefaultVideoPoster ;
private Bitmap mDefaultVideoPoster ;
private View mVideoProgressView ;
private View mVideoProgressView ;
@Override
public void getVisitedHistory ( ValueCallback < String [ ] > callback ) {
// TODO Auto-generated method stub
super . getVisitedHistory ( callback ) ;
}
@Override
@Override
public void onCloseWindow ( WebView window ) {
public void onCloseWindow ( WebView window ) {
// TODO Auto-generated method stub
// TODO Auto-generated method stub
super . onCloseWindow ( window ) ;
super . onCloseWindow ( window ) ;
}
}
@Override
public boolean onConsoleMessage ( ConsoleMessage consoleMessage ) {
// Log.i("Barebones",consoleMessage.toString());
return super . onConsoleMessage ( consoleMessage ) ;
}
@Override
@Override
public boolean onCreateWindow ( WebView view , boolean isDialog ,
public boolean onCreateWindow ( WebView view , boolean isDialog ,
boolean isUserGesture , Message resultMsg ) {
boolean isUserGesture , Message resultMsg ) {
@ -1368,57 +1342,6 @@ public class Barebones extends Activity {
resultMsg ) ;
resultMsg ) ;
}
}
@Override
public void onExceededDatabaseQuota ( String url ,
String databaseIdentifier , long quota ,
long estimatedDatabaseSize , long totalQuota ,
QuotaUpdater quotaUpdater ) {
// TODO Auto-generated method stub
super . onExceededDatabaseQuota ( url , databaseIdentifier , quota ,
estimatedDatabaseSize , totalQuota , quotaUpdater ) ;
}
@Override
public void onGeolocationPermissionsHidePrompt ( ) {
// TODO Auto-generated method stub
super . onGeolocationPermissionsHidePrompt ( ) ;
}
@Override
public boolean onJsAlert ( WebView view , String url , String message ,
JsResult result ) {
// TODO Auto-generated method stub
return super . onJsAlert ( view , url , message , result ) ;
}
@Override
public boolean onJsBeforeUnload ( WebView view , String url ,
String message , JsResult result ) {
return super . onJsBeforeUnload ( view , url , message , result ) ;
}
@Override
public boolean onJsConfirm ( WebView view , String url , String message ,
JsResult result ) {
// TODO Auto-generated method stub
return super . onJsConfirm ( view , url , message , result ) ;
}
@Override
public boolean onJsPrompt ( WebView view , String url , String message ,
String defaultValue , JsPromptResult result ) {
// TODO Auto-generated method stub
return super . onJsPrompt ( view , url , message , defaultValue , result ) ;
}
@Override
public void onProgressChanged ( WebView view , int newProgress ) {
// TODO Auto-generated method stub
super . onProgressChanged ( view , newProgress ) ;
}
@Override
@Override
public void onReachedMaxAppCacheSize ( long requiredStorage , long quota ,
public void onReachedMaxAppCacheSize ( long requiredStorage , long quota ,
QuotaUpdater quotaUpdater ) {
QuotaUpdater quotaUpdater ) {
@ -1427,19 +1350,6 @@ public class Barebones extends Activity {
super . onReachedMaxAppCacheSize ( requiredStorage , quota , quotaUpdater ) ;
super . onReachedMaxAppCacheSize ( requiredStorage , quota , quotaUpdater ) ;
}
}
@Override
public void onReceivedTouchIconUrl ( WebView view , String url ,
boolean precomposed ) {
// TODO Auto-generated method stub
super . onReceivedTouchIconUrl ( view , url , precomposed ) ;
}
@Override
public void onRequestFocus ( WebView view ) {
// TODO Auto-generated method stub
super . onRequestFocus ( view ) ;
}
@Override
@Override
public void onShowCustomView ( View view , int requestedOrientation ,
public void onShowCustomView ( View view , int requestedOrientation ,
CustomViewCallback callback ) {
CustomViewCallback callback ) {
@ -1513,7 +1423,10 @@ public class Barebones extends Activity {
if ( allowLocation = = true ) {
if ( allowLocation = = true ) {
callback . invoke ( origin , true , false ) ;
callback . invoke ( origin , true , false ) ;
} else if ( allowLocation = = false ) {
callback . invoke ( origin , false , false ) ;
} else {
} else {
Log . i ( "Barebones: " , "onGeolocationPermissionsShowPrompt()" ) ;
Log . i ( "Barebones: " , "onGeolocationPermissionsShowPrompt()" ) ;
final boolean remember = true ;
final boolean remember = true ;
@ -1574,6 +1487,8 @@ public class Barebones extends Activity {
Log . e ( "Barebones" , "ERRRRROOORRRR 1" ) ;
Log . e ( "Barebones" , "ERRRRROOORRRR 1" ) ;
} catch ( NullPointerException e ) {
} catch ( NullPointerException e ) {
Log . e ( "Barebones" , "ERRRRROOORRRR 2" ) ;
Log . e ( "Barebones" , "ERRRRROOORRRR 2" ) ;
} catch ( SQLiteException e ) {
Log . e ( "Barebones" , "SQLiteException" ) ;
}
}
}
}
} ) ;
} ) ;
@ -1641,6 +1556,7 @@ public class Barebones extends Activity {
}
}
}
}
@SuppressLint ( "SetJavaScriptEnabled" )
public AnthonyWebView BrowserSettings ( AnthonyWebView view ) {
public AnthonyWebView BrowserSettings ( AnthonyWebView view ) {
WebSettings webViewSettings = view . getSettings ( ) ;
WebSettings webViewSettings = view . getSettings ( ) ;
java = settings . getBoolean ( "java" , true ) ;
java = settings . getBoolean ( "java" , true ) ;
@ -1925,11 +1841,14 @@ public class Barebones extends Activity {
openBookmarks ( ) ;
openBookmarks ( ) ;
}
}
@SuppressWarnings ( "deprecation" )
public void deleteTab ( int id ) {
public void deleteTab ( int id ) {
int leftId = id ;
int leftId = id ;
pageIdIsVisible = false ;
pageIdIsVisible = false ;
main [ id ] . stopLoading ( ) ;
main [ id ] . stopLoading ( ) ;
main [ id ] . clearHistory ( ) ;
main [ id ] . clearHistory ( ) ;
urlToLoad [ id ] [ 0 ] = null ;
urlToLoad [ id ] [ 1 ] = null ;
if ( API > = 11 ) {
if ( API > = 11 ) {
main [ id ] . onPause ( ) ;
main [ id ] . onPause ( ) ;
}
}
@ -2390,12 +2309,6 @@ public class Barebones extends Activity {
super . finish ( ) ;
super . finish ( ) ;
}
}
@Override
protected void onDestroy ( ) {
super . onDestroy ( ) ;
}
public void trimCache ( Context context ) {
public void trimCache ( Context context ) {
try {
try {
File dir = context . getCacheDir ( ) ;
File dir = context . getCacheDir ( ) ;
@ -2429,22 +2342,30 @@ public class Barebones extends Activity {
main [ pageId ] . onPause ( ) ;
main [ pageId ] . onPause ( ) ;
}
}
main [ pageId ] . pauseTimers ( ) ;
main [ pageId ] . pauseTimers ( ) ;
String s = "" ;
for ( int n = 0 ; n < MAX_TABS ; n + + ) {
if ( urlToLoad [ n ] [ 0 ] ! = null ) {
s = s + urlToLoad [ n ] [ 0 ] + "|$|SEPARATOR|$|" ;
}
}
edit . putString ( "memory" , s ) ;
edit . commit ( ) ;
super . onPause ( ) ;
super . onPause ( ) ;
}
}
@Override
@Override
protected void onResume ( ) {
protected void onResume ( ) {
super . onResume ( ) ;
if ( API > = 11 ) {
if ( API > = 11 ) {
main [ pageId ] . onResume ( ) ;
main [ pageId ] . onResume ( ) ;
}
}
main [ pageId ] . resumeTimers ( ) ;
main [ 0 ] . resumeTimers ( ) ;
super . onResume ( ) ;
}
}
public Barebones ( ) {
public Barebones ( ) {
super ( ) ;
super ( ) ;
// TODO Auto-generated constructor stub
}
}
@Override
@Override
@ -2458,4 +2379,7 @@ public class Barebones extends Activity {
super . onNewIntent ( intent ) ;
super . onNewIntent ( intent ) ;
}
}
public static String [ ] GetArray ( String input , String delimiter ) {
return input . split ( delimiter ) ;
}
}
}