X-Git-Url: https://gitweb.stoutner.com/?p=PrivacyBrowserAndroid.git;a=blobdiff_plain;f=app%2Fsrc%2Fmain%2Fjava%2Fcom%2Fstoutner%2Fprivacybrowser%2Factivities%2FBookmarksActivity.java;h=232e3be73b3376ecc62d4e793dc938ba2926e7d9;hp=daed7937a54dadd09499b2b2ecba675818847fd2;hb=54c70ca476ba2f53ae274df1ac725be3919e8f56;hpb=e0827590ff00dc4828c5a607d992b107994ff470 diff --git a/app/src/main/java/com/stoutner/privacybrowser/activities/BookmarksActivity.java b/app/src/main/java/com/stoutner/privacybrowser/activities/BookmarksActivity.java index daed7937..232e3be7 100644 --- a/app/src/main/java/com/stoutner/privacybrowser/activities/BookmarksActivity.java +++ b/app/src/main/java/com/stoutner/privacybrowser/activities/BookmarksActivity.java @@ -79,10 +79,6 @@ public class BookmarksActivity extends AppCompatActivity implements CreateBookma // `restartFromBookmarksDatabaseViewActivity` is public static so it can be accessed from `BookmarksDatabaseViewActivity`. It is also used in `onRestart()`. public static boolean restartFromBookmarksDatabaseViewActivity; - // The current WebView strings are public static so they can be updated from `MainWebViewActivity`. They are use in `onCreate()`. - public static String currentWebViewUrl; - public static String currentWebViewTitle; - // `bookmarksDatabaseHelper` is used in `onCreate()`, `onOptionsItemSelected()`, `onBackPressed()`, `onCreateBookmark()`, `onCreateBookmarkFolder()`, `onSaveBookmark()`, `onSaveBookmarkFolder()`, // `onMoveToFolder()`, `deleteBookmarkFolderContents()`, `loadFolder()`, and `onDestroy()`. @@ -143,6 +139,10 @@ public class BookmarksActivity extends AppCompatActivity implements CreateBookma // Get the intent that launched the activity. Intent launchingIntent = getIntent(); + // Store the current URL and title. + String currentUrl = launchingIntent.getStringExtra("current_url"); + String currentTitle = launchingIntent.getStringExtra("current_title"); + // Set the current folder variable. if (launchingIntent.getStringExtra("current_folder") != null) { // Set the current folder from the intent. currentFolder = launchingIntent.getStringExtra("current_folder"); @@ -199,7 +199,7 @@ public class BookmarksActivity extends AppCompatActivity implements CreateBookma loadFolder(); } else { // The selected bookmark is not a folder. // Get the bookmark URL and assign it to `formattedUrlString`. - MainWebViewActivity.formattedUrlString = bookmarkCursor.getString(bookmarkCursor.getColumnIndex(BookmarksDatabaseHelper.BOOKMARK_URL)); + MainWebViewActivity.urlToLoadOnRestart = bookmarkCursor.getString(bookmarkCursor.getColumnIndex(BookmarksDatabaseHelper.BOOKMARK_URL)); // Set `MainWebViewActivity` to load the new URL on restart. MainWebViewActivity.loadUrlOnRestart = true; @@ -569,7 +569,7 @@ public class BookmarksActivity extends AppCompatActivity implements CreateBookma // Set the create new bookmark FAB to display the `AlertDialog`. createBookmarkFab.setOnClickListener(view -> { // Instantiate the create bookmark dialog. - DialogFragment createBookmarkDialog = CreateBookmarkDialog.createBookmark(currentWebViewUrl, currentWebViewTitle, favoriteIconBitmap); + DialogFragment createBookmarkDialog = CreateBookmarkDialog.createBookmark(currentUrl, currentTitle, favoriteIconBitmap); // Display the create bookmark dialog. createBookmarkDialog.show(getSupportFragmentManager(), getResources().getString(R.string.create_bookmark));