Skip to content

Instantly share code, notes, and snippets.

@DavyLin
Last active August 29, 2015 14:06
Show Gist options
  • Select an option

  • Save DavyLin/564a5e992093b54604be to your computer and use it in GitHub Desktop.

Select an option

Save DavyLin/564a5e992093b54604be to your computer and use it in GitHub Desktop.

Revisions

  1. DavyLin renamed this gist Sep 27, 2014. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  2. DavyLin created this gist Sep 25, 2014.
    15 changes: 15 additions & 0 deletions gistfile1.java
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,15 @@
    class MethodInLowSdk{
    public static void aMethod();
    };

    class MethodInHighSdk{
    public static void aMethod();
    }

    void CallAMethodByVersion(){
    if(android.os.Build.VERSION.SDK_INT > low_sdk){
    MethodInHighSdk.aMethod();
    }else{
    MethodInLowSdk.aMethod();
    }
    }