Android: Notification sticky notes source code example | Stick ListView item to notification with SQLiteDatabase manipulation

Android: Notification sticky notes source code example | Stick ListView item to notification with SQLiteDatabase manipulation

Figure: The final effect we will have

I’ve been searching for “notification sticky notes” this kind of stuff for days. But I still cannot find a good completed example of it. After ask around by made this function, I decided to paste my source code here to help those people whom are looking for the same solution. Let’s get started!

 

Before we’re getting to the core code, I need to declare some variables here:

Then, the core code is like this:

 

To use that core code above, we can put it into  long press button event which is handle by onContextItemSelected(). For example:

Create menu for long press button event and the reaction of it:

 

You can use it in many different way as well. In here, I’ve just shown my way for demonstration. Also, if you have any inquiries, feel free to comment below and I will get your back as soon as possible.

 

</catmee> 文章全部原创、谢绝转载,作者「BianLei」,如果喜欢欢迎分享链接,相关内容参见本站版权声明
本站相关:哔哩哔哩 | QQ空间 | YouTube ★★★ 打赏:支付宝 ★★★
Tagged , . Bookmark the permalink.

Comment Anonymously? No Problem! | 可以匿名评论了我会说?

Fill up Email address to subscribe reply and display your avatar from Gravatar (If any)
填写邮箱即可显示您在Gravatar的头像