I want to make a image viewer Kivy app which will open The app when I will click on image from file manager ..it is possible ?
--
You received this message because you are subscribed to the Google Groups "Kivy users support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to kivy-users+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/kivy-users/f0599c15-dbeb-4745-a7fc-5aa095a60b9dn%40googlegroups.com.
I want to do in android ..os
On Wed 4 Nov, 2020, 3:36 AM ElliotG, <elli...@cox.net> wrote:
Search: How to associate a file with a program in Windows--On Tuesday, November 3, 2020 at 2:59:35 PM UTC-7 sksah...@gmail.com wrote:When we click on .html file in our computer it will open web browser..and then it will show information..I want to make a image viewer Kivy app which will open The app when I will click on image from file manager ..it is possible ?
You received this message because you are subscribed to the Google Groups "Kivy users support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to kivy-...@googlegroups.com.
i want to do this ..
from kivy.app import App
from kivy.uix.label import Label
from android import mActivity,autoclass
'''
buildozer.spec:
android.manifest.intent_filters = intent_filter.xml
Requires:
./intent_filter.xml
See:
https://developer.android.com/training/sharing/receive#handling-content
'''
Intent = autoclass('android.content.Intent')
class MyApp(App):
def handle_message(self):
# This must happen during build()
intent = mActivity.getIntent()
if Intent.ACTION_SEND == intent.getAction():
if "text/plain" == intent.getType():
text = intent.getStringExtra(Intent.EXTRA_TEXT)
if text:
self.text = text
def build(self):
self.text ='No message'
self.handle_message()
return Label(text=self.text)
def on_pause(self):
# This is a hack so that the app will respond
# to a message after the app is paused.
# Obviously in a real app this would have side effects
#
# TODO Figure out how Android thinks this case should be handled.
return False
MyApp().run()
<intent-filter>
<action android:name="android.intent.action.SEND" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="text/plain" />
</intent-filter>
class MyApp(App):
def new_intent_handler(self,intent):
if Intent.ACTION_SEND == intent.getAction():
if "text/plain" == intent.getType():
text = intent.getStringExtra(Intent.EXTRA_TEXT)
if text:
self.label.text = text
def build(self):
self.label = Label(text='No message')
self.new_intent_handler(mActivity.getIntent())
activity.bind(on_new_intent=self.new_intent_handler)
return self.label