Inspired by Facebook Messenger application. The demo shows how to draw anything on top of other applications.
mollyiv / chatheads Goto Github PK
View Code? Open in Web Editor NEWLicense: MIT License
License: MIT License
Inspired by Facebook Messenger application. The demo shows how to draw anything on top of other applications.
Replace WindowManager.LayoutParams.FLAG_NOT_TOUCH_MODAL
with WindowManager.LayoutParams.FLAG_NOT_TOUCH_MODAL| WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE
when configuring LayoutParams in addToWindowManager()
method to allow users to normally use back button.
i have define the imageview below layoutInflater.inflate(R.layout.head, mFrameLayout);
and also give the click event
Here is my code:
`
Here is the place where you can inject whatever layout you want.
layoutInflater.inflate(R.layout.head, mFrameLayout);
ImageView img1 = (ImageView) findViewById(R.id.img1);
img1.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
Toast.makeText(mContext,"Hi",Toast.LENGTH_LONG).show();
}
});
`
But it gives me error on img1.setOnclickListener. Even i am not able to open keyboard if this service is running.
error log
`
Process: com.example.launchgest, PID: 14016
java.lang.RuntimeException: Unable to start service com.example.launchgest.HeadService@420e1580 with Intent { cmp=com.example.launchgest/.HeadService }: java.lang.NullPointerException
at android.app.ActivityThread.handleServiceArgs(ActivityThread.java:2924)
at android.app.ActivityThread.access$2100(ActivityThread.java:151)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1439)
at android.os.Handler.dispatchMessage(Handler.java:110)
at android.os.Looper.loop(Looper.java:193)
at android.app.ActivityThread.main(ActivityThread.java:5333)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:824)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:640)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.NullPointerException
at com.example.launchgest.HeadLayer.addToWindowManager(HeadLayer.java:53)
at com.example.launchgest.HeadLayer.(HeadLayer.java:30)
at com.example.launchgest.HeadService.initHeadLayer(HeadService.java:48)
at com.example.launchgest.HeadService.onStartCommand(HeadService.java:29)
at android.app.ActivityThread.handleServiceArgs(ActivityThread.java:2907)
at android.app.ActivityThread.access$2100(ActivityThread.java:151)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1439)
at android.os.Handler.dispatchMessage(Handler.java:110)
at android.os.Looper.loop(Looper.java:193)
at android.app.ActivityThread.main(ActivityThread.java:5333)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:824)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:640)
at dalvik.system.NativeStart.main(Native Method)
`
How can i solved that
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.