Uploaded image for project: 'Titanium SDK/CLI'
  1. Titanium SDK/CLI
  2. TIMOB-10016

Android: match() method returns: Ljava.lang.Object;@40528e70

    Details

      Description

      Issue

      Calling match() method returns a hash i.e. Ljava.lang.Object;@40528e70 that needs to be handled as an array in Android.

      Tested on

      iOS 5.1 simulator
      Android Razr 2.3.5

      DDMS console

      07-18 00:50:15.431: I/ALERT(31085): (KrollRuntimeThread) [93,93] [Ljava.lang.Object;@40528318
      07-18 00:50:15.431: I/TiAPI(31085): http://www.appcelerator.com
      

      Repro sequence

      var win = Titanium.UI.createWindow({
      	title: 'Main',
      	exitOnClose: true,
      	fullscreen: false,
      	navBarHidden: false,
      	backgroundColor: 'gray'
      });
       
      win.addEventListener('open', function() {
      	
      	var tweet = 'blah blah blah @YouTube. http://www.appcelerator.com blah blah - Spot 1';
      	extractURL(tweet);
      });
       
      win.open();
       
      function extractURL(tweet) {
       
      	var urlRegex = /(http?:\/\/[^\s]+)/g;
      	var URL = tweet.toString().match(urlRegex);
       
      	if (URL !== null) {
       
      		//URL found
      		alert( URL );
      		//alert( URL[0] );//Work Around
      		Ti.API.info( URL );
      		
      		win.add(
      			Ti.UI.createWebView({
      				url: URL
      			})
      		);
      		
      	} else {
       
      		alert('No URL found');
       
      		return;
      	}
       
      }//extractURL
      

      match Method

      https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/String/match

        Attachments

          Activity

            People

            • Assignee:
              ayeung Allen Yeung
              Reporter:
              egomez Eduardo Gomez (Inactive)
            • Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Backbone Issue Sync

                • Titanium SDK/CLI <> Titanium Mobile
                  Synced with:
                  TIMOB-5420
                  Sync status:
                  ERROR
                  Last sent:

                  Git Integration