Created
          January 8, 2012 20:42 
        
      - 
      
- 
        Save 2no/1579617 to your computer and use it in GitHub Desktop. 
    com.android.internal.R のリソースにアクセス
  
        
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | package com.wakuworks.test; | |
| import android.app.Activity; | |
| import android.content.res.Resources; | |
| import android.os.Bundle; | |
| import android.view.LayoutInflater; | |
| import android.widget.LinearLayout; | |
| // 例)QuickSearchBox の表示 | |
| // 参考:http://mpigulski.blogspot.com/2011/03/accessing-comandroidinternalr-resources.html | |
| public class SearchBarActivity extends Activity | |
| { | |
| @Override | |
| public void onCreate(Bundle savedInstanceState) | |
| { | |
| super.onCreate(savedInstanceState); | |
| int id = Resources.getSystem().getIdentifier("search_bar", "layout", "android"); | |
| LinearLayout linearLayout = new LinearLayout(this); | |
| LayoutInflater factory = LayoutInflater.from(this); | |
| factory.inflate(id, linearLayout); | |
| setContentView(linearLayout); | |
| } | |
| } | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment