TheFinestArtist / FinestWebView-Android

Beautiful and customizable Android Activity that shows web pages within an app.
https://finestwebview.web.app
2.32k stars 531 forks source link

how can i directly open my web pages without cross button on tab bar #11

Closed parmindersingh1 closed 8 years ago

parmindersingh1 commented 8 years ago

i want to open my website in webview, how can i use finestwebview to open my website directly, and without cross button on title bar (which take me back to main activity layout)

TheFinestArtist commented 8 years ago

@parmindersingh1 Ah-ha! What you are saying is you want the method to remove close button on the top bar?

parmindersingh1 commented 8 years ago

yes, I want to open directly my website in webview, Now it is opening as second activity

TheFinestArtist commented 8 years ago

@parmindersingh1 Can you explain more about your suggestion? I don't think I understand it throughly. So, you want to open a webpage without any new activity creation right? Maybe you want me to make the webview using Fragment not Activity?

parmindersingh1 commented 8 years ago

actually i am learning android, that's why i cannot tell you more technically, Actually now when i open app i go to mainactivity which open finestviewactivity on event like click, if i directly want to open in finestviewactivity webview (my website), if i dont set setContentView(R.layout.main) in oncreate of main activity and call finest webview like this new FinestWebView.Builder(this)....... Now it works but when i click cross button on top bar it takes me to blank page

TheFinestArtist commented 8 years ago

@parmindersingh1 Ah~ you are making your own website as an app right? I've done that before (https://github.com/TheFinestArtist/TheFinestArtist-Android) haha. Anyway, you need to open TheFinestWebview as your launching Activity and there is no way to do this right?

TheFinestArtist commented 8 years ago

@parmindersingh1 Here is what I would like to do to solve your problem. I will make more method such as

  1. Hide each toolbar button
  2. Disable each toolbar button

What you can do is

  1. Launch empty activity which calls TheFinestWebview such as you did right now.
  2. Remove empty activity from the stack
  3. Choose 3-a or 3-b 3-a. Hide cross button 3-b. Disable cross button and change icon of cross button as your favicon
parmindersingh1 commented 8 years ago

ok thank you for your support

TheFinestArtist commented 8 years ago
  1. Remove empty activity from the stack

Use android:noHistory="true" option in your Manifest.xml.

        <activity
            android:name=".activities.EmptyActivity"
            android:label="@string/app_name"
            android:noHistory="true">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
parmindersingh1 commented 8 years ago

thank you sir

TheFinestArtist commented 8 years ago

@parmindersingh1 I just updated FinestWebView with version 1.1.0. There is new options such as

showIconClose(boolean showIconClose);
disableIconClose(boolean disableIconClose);
showIconBack(boolean showIconBack);
disableIconBack(boolean disableIconBack);
showIconForward(boolean showIconForward);
disableIconForward(boolean disableIconForward);
showIconMenu(boolean showIconMenu);
disableIconMenu(boolean disableIconMenu);

You can use showIconClose(false) or disableIconClose(false)!