Search Results

Search found 8 results on 1 pages for 'yuku'.

Page 1/1 | 1 

  • Conditional restart on Activity onConfigurationChanged

    - by yuku
    I want to make an activity that allows orientation changes on some condition, but not otherwise. More exactly I want to prevent restarting the activity when a background thread is busy. I have put the configChanges attribute on the activity manifest, and onConfigurationChanged is called when the orientation changes. However I want to allow the app to change the orientation when allowed. @Override public void onConfigurationChanged(Configuration newConfig) { super.onConfigurationChanged(newConfig); if (orientationChangeAllowed) { // how to I restart this activity? } else { // don't do anything } }

    Read the article

  • How to have a function with a nullable string parameter in Go?

    - by yuku
    I'm used to Java's String where we can pass null rather than "" for special meanings, such as use a default value. In Go, string is a primitive type, so I cannot pass nil (null) to a parameter that requires a string. I could write the function using pointer type, like this: func f(s *string) so caller can call that function either as f(nil) or // not so elegant temp := "hello"; f(&temp) but the following is unfortunately not allowed: // elegant but disallowed f(&"hello"); What is the best way to have a parameter that receives either a string or nil?

    Read the article

  • How to implement Android Pull-to-Refresh

    - by yuku
    In Android applications such as Twitter (official app), when you encounter a ListView, you can pull it down (and it will bounce back when released) to refresh the content. I wonder what is the best way, in your opinion, to implement that? Some possibilities I could think of: An item on top of the ListView - however I don't think scrolling back to item position 1 (0-based) with animation on the ListView is an easy task. Another view outside the ListView - but I need to take care of moving the ListView position down when it is pulled, and I'm not sure if we can detect if the drag-touches to the ListView still really scroll the items on the ListView. Any recommendations?

    Read the article

  • Flash ActiveX: How to Load Movie from memory or resource or stream?

    - by yuku
    I'm embedding a Flash ActiveX control in my C++ app (Flash.ocx, Flash10a.ocx, etc depending on your Flash version). I can load an SWF file by calling LoadMovie(0, filename), but the file needs to physically reside in the disk. How to load the SWF from memory (or resource, or stream)? I'm sure there must be a way, because commercial solutions like f-in-box's feature Load flash movies from memory directly also uses Flash ActiveX control.

    Read the article

  • How do I execute a page-defined JavaScript function from a Firefox extension?

    - by yuku
    Hi, I'm creating a Firefox extension for demo purposes. I to call a specific JavaScript function in the document from the extension. I wrote this in my HTML document (not inside extension, but a page that is loaded by Firefox): document.funcToBeCalled = function() { // function body }; Then, the extension will run this on some event: var document = Application.activeWindow.activeTab.document; document.funcToBeCalled(); However it raises an error saying that funcToBeCalled is not defined. Note: I could get an element on the document by calling document.getElementById(id);

    Read the article

  • Android: How to make launcher always open the main activity instead of child activity? (or otherwise

    - by yuku
    I have activities A and B. The A is the one with LAUNCHER intent-filter (i.e. the activity that is started when we click the app icon on home screen). A launches B using startActivity(new Intent(A.this, B.class)). When the user has the B activity open, and then put my application into the background, and later my application's process is killed, when the user starts my application again, B is opened instead of A. This caused a force close in my app, because A is the activity that initializes the resources my app needs, and when B tried to access the uninitialized resources, B crashes. Do you have any suggestions what should I do in this situation?

    Read the article

  • How to create a status bar icon on the right side? (Android)

    - by yuku
    Notification and NotificationManager are used to create icons to be placed on the top-left position of the screen. A Notification also need to have an entry on the status bar pull-down. However, icons on the right side such as the battery, signal strength, wireless indicators do not need any entry on the status bar. How do I make such icons without any entry in the status bar pull-down?

    Read the article

1