Discussion Forums  >  Plugins, Customizing, Source Code

Replies: 5    Views: 4949

nadthevlad
Code is Art
Profile
Posts: 1025
Reg: Jun 07, 2012
Denver
21,850
02/06/14 11:35 PM (11 years ago)

overriding onActivityResult or using activity instead of fragment for android plugin

Working an android plugin and running into some problems with overriding the onActivityResult method. I need to override this method (onActivityResult) as part of the activity and not the fragment. As it stands right now I can't do that within the plugins fragment file. Is it possible to set the plugin up as an activity instead of as a fragment (BT 3.0)? Or is there a way to change the inheritance chain leading down to the fragment so that the override works its way up from the fragment? Or am I speaking gibberish.
 
Niraj
buzztouch Evangelist
Profile
Posts: 2943
Reg: Jul 11, 2012
Cerritos
37,930
like
02/06/14 11:37 PM (11 years ago)
Gibberish, I say mate! What ya doing down there in them strangelands of Android-ville?! -- Niraj
 
nadthevlad
Code is Art
Profile
Posts: 1025
Reg: Jun 07, 2012
Denver
21,850
like
02/07/14 12:18 AM (11 years ago)
Hey Niraj, 1. Working on the Android version of the Advanced Quiz plugin. 2. Got another plugin idea that will be popular but only if I can get it to work. I <3 IntelliJ 13
 
SmugWimp
Smugger than thou...
Profile
Posts: 6316
Reg: Nov 07, 2012
Tamuning, GU
81,410
like
02/07/14 04:29 AM (11 years ago)
You know I'm not all that great at Android, right? So if some of these suggestions seem like I don't understand what you're talking about, it's probably because I don't understand what you're talking about. For the most part. Well, sort of, but not really…. Anyway… http://stackoverflow.com/questions/6147884/onactivityresult-not-being-called-in-fragment http://stackoverflow.com/questions/6751583/is-there-a-method-that-works-like-start-fragment-for-result http://stackoverflow.com/questions/18942961/android-how-to-get-return-result-from-activity-when-calling-from-fragment http://stackoverflow.com/questions/18679127/android-onactivityresult-in-fragment-not-called They all look interesting, not sure if they'll have what you want… fingers crossed. Cheers! -- Smug
 
krompa
Lost but trying
Profile
Posts: 257
Reg: Jun 14, 2013
Bristol
8,820
like
02/07/14 05:58 AM (11 years ago)
Welcome to the dark side nadthevlad. Looking forward to see what you create. Good luck.
 
nadthevlad
Code is Art
Profile
Posts: 1025
Reg: Jun 07, 2012
Denver
21,850
like
02/07/14 08:20 PM (11 years ago)
From the links it looks like super.onActivityResult needs to be called in the activity. This is called in BT_activity_host. This is good. What I am not sure is if startActivityResult needs to be called in the fragment and if so where? Also BT_fragment which the plugin inherits from does not override onActivityResult() and does not call super.onActivityResult(). I am not sure if this is a necesary part of the inheritance chain. I am not set up real well to debug this right now so this plugin is going on the backburner.
 

Login + Screen Name Required to Post

pointerLogin to participate so you can start earning points. Once you're logged in (and have a screen name entered in your profile), you can subscribe to topics, follow users, and start learning how to make apps like the pros.