Comments (5)
You can use the service
from hover.
@jahirfiquitiva iam usign service, but when close app, hover close and reestar hover alfer seconds.
iam keep hover open when user killed app.
from hover.
@ZetDeveloper
Well, yeah, it works like that for now (at least it does for me too). Anyways, it does work when app has been closed/killed.
from hover.
i'm fix mi problem:
add this code in HoverMenuService:
``Notification serviceNotification;;
NotificationManager notificationManager;
public void showNotification() {
CharSequence tickerText = "asdads";
CharSequence tickerContent = BuildConfig.VERSION_NAME;
PendingIntent downloadManagerPendingIntent = PendingIntent.getActivity(this, 0, new Intent("android.intent.action.VIEW_DOWNLOADS").addFlags(1073741824).addFlags(67108864), 0);
Application application = getApplication();
getApplication();
this.notificationManager = (NotificationManager) application.getSystemService(Context.NOTIFICATION_SERVICE);
this.serviceNotification = new NotificationCompat.Builder(this)
.setSmallIcon(R.mipmap.ic_launcher)
.setContentTitle("Hover active")
.setContentText("1 tab")
.setOngoing(false).setPriority(-2).build();
startForeground(7524583, this.serviceNotification);
}
and call showNotification in onCreate():
public void onCreate() {
Log.d(TAG, "onCreate()");
showNotification();
mPrefs = getSharedPreferences(PREF_FILE, Context.MODE_PRIVATE);
mHoverMenu = new HoverMenuBuilder(getContextForHoverMenu())
.displayWithinWindow()
.useNavigator(createNavigator())
.useAdapter(createHoverMenuAdapter())
.restoreVisualState(loadPreferredLocation())
.build();
mHoverMenu.addOnExitListener(mWindowHoverMenuMenuExitListener);
}
from hover.
If you would like your Hover menu to live outside of your main application then what you will need to do is have your Hover menu run in its own process. That way it isn't tied to your main application process - your app can die and it won't effect your menu.
from hover.
Related Issues (20)
- migrate to Android X
- [HELP] Issue with SurfaceView HOT 5
- hoverView is invisible yet present there and its clickable.
- How to increase hover tab size HOT 1
- Consultation about bubble
- Settting position of Hover programmatically
- Back button closes the EditText's keyboard and whole menu instead of simply returning to menu view.
- Transition to AndroidX HOT 1
- Change the background color HOT 2
- Statusbar hover full screen HOT 1
- Bug problem with the management of screen spaces
- How to close HOT 2
- removing selected section causes invisible FAB (still draggable) HOT 1
- Hard drag to bottom permanently removes hover menu.
- Expo.io && Hover HOT 1
- How to change onTap?
- selectable text does not open a Context Menu
- Class does not implement the equals method
- Can't import HOT 6
- When I set an image as drawable icon for the tab, it keeps resizing itself
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from hover.