( ! ) Deprecated: Function WP_Dependencies-&gt;add_data() was called with an argument that is <strong>deprecated</strong> since version 6.9.0! IE conditional comments are ignored by all supported browsers. in /var/www/html/wp-includes/functions.php on line 6131
Call Stack
#TimeMemoryFunctionLocation
10.0000484048{main}( ).../index.php:0
20.0000484400require( '/var/www/html/wp-blog-header.php ).../index.php:17
30.10254104568require_once( '/var/www/html/wp-includes/template-loader.php ).../wp-blog-header.php:19
40.10314133560include( '/var/www/html/wp-content/themes/twentyfifteen/single.php ).../template-loader.php:125
50.10314133560get_header( $name = ???, $args = ??? ).../single.php:10
60.10314133776locate_template( $template_names = [0 => 'header.php'], $load = TRUE, $load_once = TRUE, $args = [] ).../general-template.php:48
70.10314133872load_template( $_template_file = '/var/www/html/wp-content/themes/twentyfifteen/header.php', $load_once = TRUE, $args = [] ).../template.php:749
80.10314134416require_once( '/var/www/html/wp-content/themes/twentyfifteen/header.php ).../template.php:814
90.10324141824wp_head( ).../header.php:18
100.10324141824do_action( $hook_name = 'wp_head' ).../general-template.php:3197
110.10324142040WP_Hook->do_action( $args = [0 => ''] ).../plugin.php:522
120.10324142040WP_Hook->apply_filters( $value = '', $args = [0 => ''] ).../class-wp-hook.php:365
130.10344145456wp_enqueue_scripts( '' ).../class-wp-hook.php:341
140.10344145456do_action( $hook_name = 'wp_enqueue_scripts' ).../script-loader.php:2311
150.10344145672WP_Hook->do_action( $args = [0 => ''] ).../plugin.php:522
160.10344145672WP_Hook->apply_filters( $value = '', $args = [0 => ''] ).../class-wp-hook.php:365
170.10354147560twentyfifteen_scripts( '' ).../class-wp-hook.php:341
180.10364149080wp_style_add_data( $handle = 'twentyfifteen-ie', $key = 'conditional', $value = 'lt IE 9' ).../functions.php:440
190.10364149080WP_Styles->add_data( $handle = 'twentyfifteen-ie', $key = 'conditional', $value = 'lt IE 9' ).../functions.wp-styles.php:245
200.10364149080WP_Dependencies->add_data( $handle = 'twentyfifteen-ie', $key = 'conditional', $value = 'lt IE 9' ).../class-wp-styles.php:385
210.10364149080_deprecated_argument( $function_name = 'WP_Dependencies->add_data()', $version = '6.9.0', $message = 'IE conditional comments are ignored by all supported browsers.' ).../class-wp-dependencies.php:317
220.10364155032wp_trigger_error( $function_name = '', $message = 'Function WP_Dependencies->add_data() was called with an argument that is <strong>deprecated</strong> since version 6.9.0! IE conditional comments are ignored by all supported browsers.', $error_level = 16384 ).../functions.php:5925
230.10374274568trigger_error( $message = 'Function WP_Dependencies-&gt;add_data() was called with an argument that is <strong>deprecated</strong> since version 6.9.0! IE conditional comments are ignored by all supported browsers.', $error_level = 16384 ).../functions.php:6131

( ! ) Deprecated: Function WP_Dependencies-&gt;add_data() was called with an argument that is <strong>deprecated</strong> since version 6.9.0! IE conditional comments are ignored by all supported browsers. in /var/www/html/wp-includes/functions.php on line 6131
Call Stack
#TimeMemoryFunctionLocation
10.0000484048{main}( ).../index.php:0
20.0000484400require( '/var/www/html/wp-blog-header.php ).../index.php:17
30.10254104568require_once( '/var/www/html/wp-includes/template-loader.php ).../wp-blog-header.php:19
40.10314133560include( '/var/www/html/wp-content/themes/twentyfifteen/single.php ).../template-loader.php:125
50.10314133560get_header( $name = ???, $args = ??? ).../single.php:10
60.10314133776locate_template( $template_names = [0 => 'header.php'], $load = TRUE, $load_once = TRUE, $args = [] ).../general-template.php:48
70.10314133872load_template( $_template_file = '/var/www/html/wp-content/themes/twentyfifteen/header.php', $load_once = TRUE, $args = [] ).../template.php:749
80.10314134416require_once( '/var/www/html/wp-content/themes/twentyfifteen/header.php ).../template.php:814
90.10324141824wp_head( ).../header.php:18
100.10324141824do_action( $hook_name = 'wp_head' ).../general-template.php:3197
110.10324142040WP_Hook->do_action( $args = [0 => ''] ).../plugin.php:522
120.10324142040WP_Hook->apply_filters( $value = '', $args = [0 => ''] ).../class-wp-hook.php:365
130.10344145456wp_enqueue_scripts( '' ).../class-wp-hook.php:341
140.10344145456do_action( $hook_name = 'wp_enqueue_scripts' ).../script-loader.php:2311
150.10344145672WP_Hook->do_action( $args = [0 => ''] ).../plugin.php:522
160.10344145672WP_Hook->apply_filters( $value = '', $args = [0 => ''] ).../class-wp-hook.php:365
170.10354147560twentyfifteen_scripts( '' ).../class-wp-hook.php:341
180.12894275672wp_style_add_data( $handle = 'twentyfifteen-ie7', $key = 'conditional', $value = 'lt IE 8' ).../functions.php:444
190.12894275672WP_Styles->add_data( $handle = 'twentyfifteen-ie7', $key = 'conditional', $value = 'lt IE 8' ).../functions.wp-styles.php:245
200.12894275672WP_Dependencies->add_data( $handle = 'twentyfifteen-ie7', $key = 'conditional', $value = 'lt IE 8' ).../class-wp-styles.php:385
210.12904275672_deprecated_argument( $function_name = 'WP_Dependencies->add_data()', $version = '6.9.0', $message = 'IE conditional comments are ignored by all supported browsers.' ).../class-wp-dependencies.php:317
220.12904275992wp_trigger_error( $function_name = '', $message = 'Function WP_Dependencies->add_data() was called with an argument that is <strong>deprecated</strong> since version 6.9.0! IE conditional comments are ignored by all supported browsers.', $error_level = 16384 ).../functions.php:5925
230.12904276216trigger_error( $message = 'Function WP_Dependencies-&gt;add_data() was called with an argument that is <strong>deprecated</strong> since version 6.9.0! IE conditional comments are ignored by all supported browsers.', $error_level = 16384 ).../functions.php:6131

android 如何保存簡單的配置信息(SharedPreferences、File和Properties)

我們知道在android的開發中,保存項目私有數據的存儲方式我們可以使用:SharedPreferences,File,SQLite,Network.四種方式,而要用到應
用程序之間數據的共享要使用ContentProvider 。那今天我們只敘述一下僅僅保存一些我們登錄等的一些配置信息的數據,也就是說用到的數
據量都不是很大,那麼我們就可以選擇SharedPreferences和File的方式。這裡只針對性的結合File和Properties進行敘述。
一。SharedPreferences

1. 它可以保存上一次用戶所做的修改或者自定義參數的設定,當再次啟動程序後依然可以保持原有的設置。這裡只說明一下使用方式。比如下
面的代碼在OnCreate中使用:

SharedPreferences mSharedPreferences = getSharedPreferences(“list”,MODE_PRIVATE);

String mTempString = mSharedPreferences.getString(“config”,”default”);

其中”list”是SharedPreferences的文件的名字,SharedPreferences是以鍵值映射的關係存放數據。不過多解釋,你也可以這樣用:

SharedPreferences mSharedPreferences = getPreferences(MODE_PRIVATE);

這樣默認的文件名是activity的名字。

2. 退出activity的時候保存數據,在OnPause中使用:

SharedPreferences mSharedPreferences = getSharedPreferences(“list”,    MODE_PRIVATE);

mSharedPreferences.edit().putString(“config”,”data” ).commit();

3. SharedPreferences 是以xml文件的方式自動保存的,在DDMS中的FileExplorer中展開/data/data/包名/shared-prefs下面就是SharedPreferences文件。

4. SharedPreferences文件只可以用來存放基本的數據類型。
二。結合File和Properties進行保存。

A Properties object is a Hashtable where the keys and values must be Strings. Each property can have a default Properties list which specifies the default values to be used when a given key is not found in this Properties instance.

1.所以,Properties對象也是一個哈希表,也是一個鍵值對應的關係,因此和上面的操作相似。下面看具體的程序。

public class File_ByProperties extends Activity {

private boolean mStatus;

private TextView mShowStatus;
/** Called when the activity is first created. */

@Override

public void onCreate(Bundle savedInstanceState) {

super.onCreate(savedInstanceState);

setContentView(R.layout.main);

mShowStatus = (TextView) findViewById(R.id.show);

load();

}
private void load() {

// TODO Auto-generated method stub

Properties mProperties = new Properties();

try {

FileInputStream mInputStream = openFileInput(“configuration”);

mProperties.load(mInputStream);

mStatus = Boolean.valueOf(mProperties.get(“status”).toString());

mShowStatus.setText(“the status is : ” + mStatus);

} catch (FileNotFoundException e) {

// TODO Auto-generated catch block

System.out.println(e.toString());

} catch (IOException e) {

System.out.println(e.toString());

}

}
@Override

public boolean onKeyDown(int keyCode, KeyEvent event) {

// TODO Auto-generated method stub

if (keyCode == KeyEvent.KEYCODE_DPAD_UP) {

mStatus = !mStatus;

mShowStatus.setText(“the status is : ” + mStatus);

}

return super.onKeyDown(keyCode, event);

}
@Override

protected void onPause() {

// TODO Auto-generated method stub

super.onPause();

Properties mProperties = new Properties();

if (mProperties.containsKey(“status”)) {

mProperties.remove(“status”);

}

mProperties.put(“status”, String.valueOf(mStatus));

try {

FileOutputStream mOutputStream = openFileOutput(“configuration”,     MODE_WORLD_WRITEABLE);

mProperties.store(mOutputStream, null);

} catch (FileNotFoundException e) {

// TODO Auto-generated catch block

e.printStackTrace();

} catch (IOException e) {

e.printStackTrace();

}

}
}

2. 在DDMS中的FileExplorer中展開/data/data/包名/files,可以查看到該文件。
三。你還可以將一個靜態的文件放到res/raw/下面,然後通過getResources().openRawResource(R.raw.文件);來得到一個InputStream對象,然後讀取文件的內容。

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.