<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>WANGXUCHAO.CN</title>
	<atom:link href="https://www.wangxuchao.cn/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.wangxuchao.cn</link>
	<description></description>
	<lastBuildDate>Fri, 23 Jan 2026 02:15:24 +0000</lastBuildDate>
	<language>zh-Hans</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.8.3</generator>
	<item>
		<title>Kernel panic &#8211; not syncing: VFS: Unable to mount root fs on unknown-block(0,0)</title>
		<link>https://www.wangxuchao.cn/kernel-panic-not-syncing-vfs-unable-to-mount-root-fs-on-unknown-block00/</link>
					<comments>https://www.wangxuchao.cn/kernel-panic-not-syncing-vfs-unable-to-mount-root-fs-on-unknown-block00/#respond</comments>
		
		<dc:creator><![CDATA[wangxuchao]]></dc:creator>
		<pubDate>Fri, 23 Jan 2026 01:09:51 +0000</pubDate>
				<category><![CDATA[未分类]]></category>
		<guid isPermaLink="false">https://www.wangxuchao.cn/?p=172</guid>

					<description><![CDATA[这是一个非常经典的 Linux 启动错误。根据截图中的关键信息： 核心错误信息：&#160;Kernel pa &#8230; <p class="link-more"><a href="https://www.wangxuchao.cn/kernel-panic-not-syncing-vfs-unable-to-mount-root-fs-on-unknown-block00/" class="more-link">继续阅读<span class="screen-reader-text">“Kernel panic &#8211; not syncing: VFS: Unable to mount root fs on unknown-block(0,0)”</span></a></p>]]></description>
										<content:encoded><![CDATA[
<figure class="wp-block-image size-full"><img fetchpriority="high" decoding="async" width="789" height="453" src="https://www.wangxuchao.cn/wp-content/uploads/2026/01/ScreenShot_2026-01-23_085452_042.png" alt="" class="wp-image-173" srcset="https://www.wangxuchao.cn/wp-content/uploads/2026/01/ScreenShot_2026-01-23_085452_042.png 789w, https://www.wangxuchao.cn/wp-content/uploads/2026/01/ScreenShot_2026-01-23_085452_042-300x172.png 300w, https://www.wangxuchao.cn/wp-content/uploads/2026/01/ScreenShot_2026-01-23_085452_042-768x441.png 768w" sizes="(max-width: 789px) 100vw, 789px" /></figure>



<p>这是一个非常经典的 Linux 启动错误。根据截图中的关键信息：</p>



<p><strong>核心错误信息：</strong>&nbsp;<code>Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)</code></p>



<p><strong>分析原因：</strong>&nbsp;这个错误表明 Linux 内核已经成功加载，但是它<strong>无法挂载根文件系统（Root Filesystem）</strong>。简单来说，内核启动了，但找不到真正的操作系统文件在哪里。</p>



<p><code>unknown-block(0,0)</code>&nbsp;这个特定的代码通常指向以下几个最常见的原因：</p>



<ol class="wp-block-list">
<li><strong>initramfs/initrd 损坏或丢失（最常见）</strong>
<ul class="wp-block-list">
<li>Linux 启动需要一个临时的文件系统（initramfs）来加载加载根分区所需的驱动程序。</li>



<li>如果在上次系统更新（例如&nbsp;<code>apt upgrade</code>）过程中，<code>initrd.img</code>&nbsp;文件生成失败（可能因为&nbsp;<code>/boot</code>&nbsp;分区满了，或者中途断电），内核就无法识别硬盘或文件系统，从而报错。</li>
</ul>
</li>



<li><strong>GRUB 配置错误</strong>
<ul class="wp-block-list">
<li>引导加载程序（GRUB）传递给内核的&nbsp;<code>root=</code>&nbsp;参数指向了一个不存在的设备，或者 UUID 发生了变化。</li>
</ul>
</li>



<li><strong>VMware 虚拟化特定的驱动问题</strong>
<ul class="wp-block-list">
<li>截图显示你在使用&nbsp;<code>VMware Virtual Platform</code>。</li>



<li>如果你最近更改了虚拟机的硬盘控制器类型（例如从 LSI Logic 改为 PVSCSI），而 initramfs 里没有包含新的驱动，也会导致内核找不到硬盘。</li>
</ul>
</li>



<li><strong>内核版本不匹配</strong>
<ul class="wp-block-list">
<li>你正在尝试启动的内核版本&nbsp;<code>5.15.0-164-generic</code>&nbsp;可能有问题，或者与其配套的 initrd 文件不匹配。</li>
</ul>
</li>
</ol>



<hr class="wp-block-separator has-alpha-channel-opacity"/>



<p><strong>如何修复（建议步骤）：</strong></p>



<p><strong>方法 1：尝试启动旧内核（最简单）</strong></p>



<ol class="wp-block-list">
<li>重启虚拟机。</li>



<li>在启动过程中，按住&nbsp;<code>Shift</code>&nbsp;键（或&nbsp;<code>Esc</code>&nbsp;键）进入&nbsp;<strong>GRUB 菜单</strong>。</li>



<li>选择&nbsp;<strong>&#8220;Advanced options for Ubuntu&#8221;</strong>（Ubuntu 高级选项）。</li>



<li>列表中会有多个内核版本。选择一个带有版本号较旧的内核（不要选带有&nbsp;<code>recovery mode</code>&nbsp;的，除非普通模式也不行）。</li>



<li>如果旧内核能成功进入系统，说明是新内核的 initramfs 坏了。</li>



<li>进入系统后，运行以下命令修复：
<ul class="wp-block-list">
<li><code>sudo dpkg --configure -a</code></li>



<li><code>sudo update-initramfs -u -k all </code></li>



<li><code>sudo update-grub </code></li>
</ul>
</li>



<li><em>注意：如果你的&nbsp;<code>/boot</code>&nbsp;分区满了，你需要先清理旧内核释放空间。</em></li>
</ol>



<p><strong>方法 2：使用 Live CD/ISO 修复</strong>&nbsp;如果方法 1 无效，你需要：</p>



<ol class="wp-block-list">
<li>加载 Ubuntu 安装镜像（ISO）启动虚拟机，选择 &#8220;Try Ubuntu&#8221;。</li>



<li>挂载原来的系统磁盘，并使用&nbsp;<code>chroot</code>&nbsp;进入环境重新生成 initramfs（这个过程比较复杂，建议先试方法 1）。</li>
</ol>



<p><strong>总结：</strong>&nbsp;这大概率是一次系统更新导致&nbsp;<code>initramfs</code>&nbsp;生成不完整引起的。尝试通过 GRUB 菜单引导旧内核通常能解决问题。</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.wangxuchao.cn/kernel-panic-not-syncing-vfs-unable-to-mount-root-fs-on-unknown-block00/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>java.lang.ClassCastException: android.view.AbsSavedState$1 cannot be cast to androidx.appcompat.widget.AppCompatSpinner$SavedState</title>
		<link>https://www.wangxuchao.cn/java-lang-classcastexception-android-view-abssavedstate1-cannot-be-cast-to-androidx-appcompat-widget-appcompatspinnersavedstate/</link>
		
		<dc:creator><![CDATA[wangxuchao]]></dc:creator>
		<pubDate>Tue, 12 Mar 2024 02:56:59 +0000</pubDate>
				<category><![CDATA[Android]]></category>
		<guid isPermaLink="false">https://www.wangxuchao.cn/?p=162</guid>

					<description><![CDATA[今天遇到一个返回上一个Fragment闪退的问题，下面是大致代码： 第一次进入页面正常，当跳转到下一个页面，再 &#8230; <p class="link-more"><a href="https://www.wangxuchao.cn/java-lang-classcastexception-android-view-abssavedstate1-cannot-be-cast-to-androidx-appcompat-widget-appcompatspinnersavedstate/" class="more-link">继续阅读<span class="screen-reader-text">“java.lang.ClassCastException: android.view.AbsSavedState$1 cannot be cast to androidx.appcompat.widget.AppCompatSpinner$SavedState”</span></a></p>]]></description>
										<content:encoded><![CDATA[
<p>今天遇到一个返回上一个Fragment闪退的问题，下面是大致代码：</p>



<pre class="wp-block-code"><code>// xxx_layout.xml
&lt;layout>
    &lt;include layout="@layout/view_edit_spinner" />
    &lt;include layout="@layout/view_edit_textview" />
&lt;/layout>

// view_edit_spinner.xml
&lt;LinearLayout>
    &lt;androidx.appcompat.widget.AppCompatSpinner
            <strong><em>android:id="@+id/edit_value"</em></strong>
            android:layout_width="match_parent"
            android:layout_height="match_parent"/>
&lt;/LinearLayout>

// view_edit_textview.xml
&lt;LinearLayout>
    &lt;androidx.appcompat.widget.AppCompatTextView
            <strong><em>android:id="@+id/edit_value"</em></strong>
            android:layout_width="match_parent"
            android:layout_height="match_parent"/>
&lt;/LinearLayout></code></pre>



<p>第一次进入页面正常，当跳转到下一个页面，再返回当前页面时，会报错闪退，而且是系统平台级的，经过排查，是由于引用其他布局文件，不同控件的<strong><em>resId</em></strong> 一样，导致系统尝试恢复原来状态时类型转换错误。</p>



<p>解决方法：<strong><em>android:id=&#8221;@+id/edit_value&#8221;</em></strong> 中的id不同控件改成不一样的即可</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>RecyclerView显示所有元素，不需要包含在NestedScrollView中</title>
		<link>https://www.wangxuchao.cn/recyclerview%e6%98%be%e7%a4%ba%e6%89%80%e6%9c%89%e5%85%83%e7%b4%a0%ef%bc%8c%e4%b8%8d%e9%9c%80%e8%a6%81%e5%8c%85%e5%90%ab%e5%9c%a8nestedscrollview%e4%b8%ad/</link>
		
		<dc:creator><![CDATA[wangxuchao]]></dc:creator>
		<pubDate>Fri, 22 Dec 2023 03:57:11 +0000</pubDate>
				<category><![CDATA[Android]]></category>
		<guid isPermaLink="false">https://www.wangxuchao.cn/?p=159</guid>

					<description><![CDATA[]]></description>
										<content:encoded><![CDATA[
<pre class="wp-block-code"><code>import android.content.Context
import android.util.AttributeSet
import androidx.recyclerview.widget.RecyclerView

class DynamicHeightRecyclerView(context: Context, attrs: AttributeSet) :
    RecyclerView(context, attrs) {

    override fun onMeasure(widthSpec: Int, heightSpec: Int) {
        super.onMeasure(
            widthSpec,
            MeasureSpec.makeMeasureSpec(Int.MAX_VALUE shr 2, MeasureSpec.AT_MOST)
        )
    }
}</code></pre>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Android Adapter调用notifyDataSetChanged()列表不更新的问题</title>
		<link>https://www.wangxuchao.cn/android-adapter%e8%b0%83%e7%94%a8notifydatasetchanged%e5%88%97%e8%a1%a8%e4%b8%8d%e6%9b%b4%e6%96%b0%e7%9a%84%e9%97%ae%e9%a2%98/</link>
		
		<dc:creator><![CDATA[wangxuchao]]></dc:creator>
		<pubDate>Thu, 19 May 2022 01:11:00 +0000</pubDate>
				<category><![CDATA[Android]]></category>
		<guid isPermaLink="false">https://www.wangxuchao.cn/?p=148</guid>

					<description><![CDATA[目前发现一个Adapter调用notifyDataSetChanged()列表不更新的问题，代码如下： 原因： &#8230; <p class="link-more"><a href="https://www.wangxuchao.cn/android-adapter%e8%b0%83%e7%94%a8notifydatasetchanged%e5%88%97%e8%a1%a8%e4%b8%8d%e6%9b%b4%e6%96%b0%e7%9a%84%e9%97%ae%e9%a2%98/" class="more-link">继续阅读<span class="screen-reader-text">“Android Adapter调用notifyDataSetChanged()列表不更新的问题”</span></a></p>]]></description>
										<content:encoded><![CDATA[
<pre class="wp-block-preformatted">目前发现一个Adapter调用<strong>notifyDataSetChanged()</strong>列表不更新的问题，代码如下：</pre>



<pre class="wp-block-code"><code>mChannelList = channelListBean.getList();
huodaoInfoAdapter.notifyDataSetChanged();</code></pre>



<p>原因：channelListBean.getList()和mChannelList是两个不同的变量，内存地址不同，赋值语句将新的内存地址赋给mChannelList，而Adapter中保留的list还是原来的内存地址。</p>



<p>解决方法：</p>



<pre class="wp-block-code"><code>if (!mChannelList.isEmpty()) {
  mChannelList.clear();
}
mChannelList.addAll(channelListBean.getList());

huodaoInfoAdapter.notifyDataSetChanged();</code></pre>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>小米手机MIUI抓取蓝牙日志</title>
		<link>https://www.wangxuchao.cn/%e5%b0%8f%e7%b1%b3%e6%89%8b%e6%9c%bamiui%e6%8a%93%e5%8f%96%e8%93%9d%e7%89%99%e6%97%a5%e5%bf%97/</link>
		
		<dc:creator><![CDATA[wangxuchao]]></dc:creator>
		<pubDate>Tue, 22 Dec 2020 02:04:11 +0000</pubDate>
				<category><![CDATA[Android]]></category>
		<guid isPermaLink="false">https://www.wangxuchao.cn/?p=129</guid>

					<description><![CDATA[1.打开开发者选项，打开蓝牙调试日志和蓝牙数据包日志开关 2.在拨号盘输入一次&#160;&#160;*#*# &#8230; <p class="link-more"><a href="https://www.wangxuchao.cn/%e5%b0%8f%e7%b1%b3%e6%89%8b%e6%9c%bamiui%e6%8a%93%e5%8f%96%e8%93%9d%e7%89%99%e6%97%a5%e5%bf%97/" class="more-link">继续阅读<span class="screen-reader-text">“小米手机MIUI抓取蓝牙日志”</span></a></p>]]></description>
										<content:encoded><![CDATA[
<p>1.打开开发者选项，打开蓝牙调试日志和蓝牙数据包日志开关</p>



<p>2.在拨号盘输入一次&nbsp;&nbsp;*#*#5959#*#*&nbsp;&nbsp;即开始抓蓝牙日志</p>



<p>3.操作APP，进行蓝牙通信</p>



<p>4.再拨号盘输入一次&nbsp;&nbsp;*#*#5959#*#*</p>



<p>5.等待大概半分钟，在文件管理器中 /sdcard/MIUI/debug_log下会生成蓝牙日志文件</p>



<p>6.使用wireshark打开蓝牙日志文件</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>javax.net.ssl.SSLHandshakeException: com.android.org.bouncycastle.jce.exception.ExtCertPathValidatorException: Could not validate certificate</title>
		<link>https://www.wangxuchao.cn/javax-net-ssl-sslhandshakeexception-com-android-org-bouncycastle-jce-exception-extcertpathvalidatorexception-could-not-validate-certificate/</link>
		
		<dc:creator><![CDATA[wangxuchao]]></dc:creator>
		<pubDate>Tue, 23 Jun 2020 02:15:57 +0000</pubDate>
				<category><![CDATA[未分类]]></category>
		<category><![CDATA[android]]></category>
		<guid isPermaLink="false">https://www.wangxuchao.cn/?p=117</guid>

					<description><![CDATA[MqttException (0) &#8211; javax.net.ssl.SSLHandshakeExc &#8230; <p class="link-more"><a href="https://www.wangxuchao.cn/javax-net-ssl-sslhandshakeexception-com-android-org-bouncycastle-jce-exception-extcertpathvalidatorexception-could-not-validate-certificate/" class="more-link">继续阅读<span class="screen-reader-text">“javax.net.ssl.SSLHandshakeException: com.android.org.bouncycastle.jce.exception.ExtCertPathValidatorException: Could not validate certificate”</span></a></p>]]></description>
										<content:encoded><![CDATA[
<p>MqttException (0) &#8211; javax.net.ssl.SSLHandshakeException: com.android.org.bouncycastle.jce.exception.ExtCertPathValidatorException: Could not validate certificate: Certificate not valid until Fri Feb 28 09:25:13 GMT+08:00 2020 (compared to Mon Jan 21 17:46:42 GMT+08:00 2013)</p>



<p>SSL连接报错，原因是Android终端时间不对，和当前时间相差太大</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>记录一下Fragment连续跳转2次返回首页时第三个页面还显示的问题</title>
		<link>https://www.wangxuchao.cn/%e8%ae%b0%e5%bd%95%e4%b8%80%e4%b8%8bfragment%e8%bf%9e%e7%bb%ad%e8%b7%b3%e8%bd%ac2%e6%ac%a1%e8%bf%94%e5%9b%9e%e9%a6%96%e9%a1%b5%e6%97%b6%e7%ac%ac%e4%b8%89%e4%b8%aa%e9%a1%b5%e9%9d%a2%e8%bf%98%e6%98%be/</link>
		
		<dc:creator><![CDATA[wangxuchao]]></dc:creator>
		<pubDate>Mon, 06 Jan 2020 14:49:38 +0000</pubDate>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[Fragment]]></category>
		<guid isPermaLink="false">https://www.wangxuchao.cn/?p=105</guid>

					<description><![CDATA[有个需求是 “ A页面 ”跳转“ B页面 ”然后跳转“ C页面 ”。 在使用Fragment进行页面跳转的时候 &#8230; <p class="link-more"><a href="https://www.wangxuchao.cn/%e8%ae%b0%e5%bd%95%e4%b8%80%e4%b8%8bfragment%e8%bf%9e%e7%bb%ad%e8%b7%b3%e8%bd%ac2%e6%ac%a1%e8%bf%94%e5%9b%9e%e9%a6%96%e9%a1%b5%e6%97%b6%e7%ac%ac%e4%b8%89%e4%b8%aa%e9%a1%b5%e9%9d%a2%e8%bf%98%e6%98%be/" class="more-link">继续阅读<span class="screen-reader-text">“记录一下Fragment连续跳转2次返回首页时第三个页面还显示的问题”</span></a></p>]]></description>
										<content:encoded><![CDATA[
<p>有个需求是 “ A页面 ”跳转“ B页面 ”然后跳转“ C页面 ”。</p>



<p>在使用Fragment进行页面跳转的时候，第一次跳转（A-&gt;B）加.addToBackStack(null) ，第二次跳转（B-&gt;C）不加，然后点击返回按钮</p>



<p>期望状态是B、C消失，A出现</p>



<p>可是最终效果是返回到了A页面同时C页面还在，并没有被destroy，当进入另一个界面返回到A，这时候C会重新生成</p>



<p><strong>原因：</strong>点击返回键只回滚了第一次跳转（<strong>A</strong>-&gt;<strong>B</strong>）加.addToBackStack(null) ，C页面没有影响，也不会重新生成。A重新跳转到其他页面变成（<strong>A、C</strong>-&gt;<strong>B</strong>） 加.addToBackStack(null) ,返回的时候会回滚A、C两个页面的状态</p>



<p><strong>解决方案：</strong>（<strong>B</strong>-&gt;<strong>C</strong>）加.addToBackStack(null)  </p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>解决Android 应用接入USB输入设备后应用重跑onCreate的问题</title>
		<link>https://www.wangxuchao.cn/%e8%a7%a3%e5%86%b3android-%e5%ba%94%e7%94%a8%e6%8e%a5%e5%85%a5usb%e8%be%93%e5%85%a5%e8%ae%be%e5%a4%87%e5%90%8e%e5%ba%94%e7%94%a8%e9%87%8d%e8%b7%91oncreate%e7%9a%84%e9%97%ae%e9%a2%98/</link>
		
		<dc:creator><![CDATA[wangxuchao]]></dc:creator>
		<pubDate>Sat, 04 Jan 2020 08:54:39 +0000</pubDate>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[android]]></category>
		<category><![CDATA[USB]]></category>
		<guid isPermaLink="false">https://www.wangxuchao.cn/?p=102</guid>

					<description><![CDATA[解决方案: 在AndroidManifest.xml中, 指定activity的定义加上: android:c &#8230; <p class="link-more"><a href="https://www.wangxuchao.cn/%e8%a7%a3%e5%86%b3android-%e5%ba%94%e7%94%a8%e6%8e%a5%e5%85%a5usb%e8%be%93%e5%85%a5%e8%ae%be%e5%a4%87%e5%90%8e%e5%ba%94%e7%94%a8%e9%87%8d%e8%b7%91oncreate%e7%9a%84%e9%97%ae%e9%a2%98/" class="more-link">继续阅读<span class="screen-reader-text">“解决Android 应用接入USB输入设备后应用重跑onCreate的问题”</span></a></p>]]></description>
										<content:encoded><![CDATA[
<p>解决方案:</p>



<p> 在AndroidManifest.xml中, 指定activity的定义加上:  </p>



<blockquote class="wp-block-quote is-layout-flow wp-block-quote-is-layout-flow"><p>  android:configChanges=&#8221;screenSize|keyboard|keyboardHidden|navigation&#8221; </p></blockquote>



<blockquote class="wp-block-quote is-layout-flow wp-block-quote-is-layout-flow"><p>  <a href="https://blog.csdn.net/ansondroider/article/details/88238322">https://blog.csdn.net/ansondroider/article/details/88238322</a>  </p></blockquote>



<p></p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>阿拉伯数字转中文汉字</title>
		<link>https://www.wangxuchao.cn/%e9%98%bf%e6%8b%89%e4%bc%af%e6%95%b0%e5%ad%97%e8%bd%ac%e4%b8%ad%e6%96%87%e6%b1%89%e5%ad%97/</link>
		
		<dc:creator><![CDATA[wangxuchao]]></dc:creator>
		<pubDate>Sat, 05 Jan 2019 02:44:33 +0000</pubDate>
				<category><![CDATA[未分类]]></category>
		<guid isPermaLink="false">http://www.wangxuchao.cn/?p=57</guid>

					<description><![CDATA[在使用某些语音合成引擎的时候，遇到一些问题，比如三位数的数字110，语音合成播放是幺幺零，但是我想让她合成一百 &#8230; <p class="link-more"><a href="https://www.wangxuchao.cn/%e9%98%bf%e6%8b%89%e4%bc%af%e6%95%b0%e5%ad%97%e8%bd%ac%e4%b8%ad%e6%96%87%e6%b1%89%e5%ad%97/" class="more-link">继续阅读<span class="screen-reader-text">“阿拉伯数字转中文汉字”</span></a></p>]]></description>
										<content:encoded><![CDATA[<p>在使用某些语音合成引擎的时候，遇到一些问题，比如三位数的数字110，语音合成播放是幺幺零，但是我想让她合成一百一十，怎么做呢？</p>
<p>所以我打算把阿拉伯数字转换成中文汉字就可以正常合成了，代码如下：</p>
<blockquote>
<pre>public class NumberHanFormat {
    public static final String ZERO = "零";
    public static final String NEGATIVE = "负";
    public static final String SPACE = " ";
    public static final String MILLION = "百万";
    public static final String THOUSAND = "千";
    public static final String HUNDRED = "百";
    public static final String[] INDNUM = {"零", "一", "二", "三", "四", "五", "六",
            "七", "八", "九", "十", "十一", "十二", "十三",
            "十四", "十五", "十六", "十七", "十八", "十九"};
    public static final String[] DECNUM = {"零","一十","二十", "三十", "四十", "五十", "六十",
            "七十", "八十", "九十"};

    //数字转换汉字
    public String format(int i) {

        StringBuilder sb = new StringBuilder();

        if(i == 0) {
            return ZERO;
        }

        if(i &lt; 0) {
            sb.append(NEGATIVE);
            i *= -1;
        }


        if(i &gt;= 1000000) {
            sb.append(numFormat(i / 1000000)).append(MILLION);
            i %= 1000000;

        }

        if(i &gt;= 1000) {
            sb.append(numFormat(i / 1000)).append(THOUSAND);

            i %= 1000;
        }

        if(i &lt; 1000){
            sb.append(numFormat(i));
        }

        return sb.toString();
    }

    // 3位数转汉字
    public String numFormat(int i) {

        StringBuilder sb = new StringBuilder();

        if(i &gt;= 100) {
            sb.append(INDNUM[i / 100]).append(HUNDRED);
        }

        int j = i%100;

        if(j != 0) {
            if(j &gt;= 20) {
                sb.append(DECNUM[j / 10]);
                if(j % 10 != 0) {
                    sb.append(INDNUM[j % 10]);
                }
            } else {
                if(i&gt;100) {
                    if(j&lt;10) {
                        sb.append(DECNUM[j / 10]).append(INDNUM[j % 10]);
                    } else {
                        sb.append(DECNUM[1]).append(INDNUM[j % 10]);
                    }
                } else {
                    sb.append(INDNUM[j]);
                }
            }
        }

        return sb.toString();
    }
}</pre>
</blockquote>
<p>调用方法：</p>
<blockquote>
<pre>public static NumberWordFormat mNumberWordFormat;
mNumberWordFormat = new NumberWordFormat();
mNumberWordFormat.format(power1)</pre>
</blockquote>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>网站黑白css</title>
		<link>https://www.wangxuchao.cn/%e7%bd%91%e7%ab%99%e9%bb%91%e7%99%bdcss/</link>
		
		<dc:creator><![CDATA[wangxuchao]]></dc:creator>
		<pubDate>Wed, 04 Jul 2018 09:27:56 +0000</pubDate>
				<category><![CDATA[未分类]]></category>
		<guid isPermaLink="false">http://www.wangxuchao.cn/?p=52</guid>

					<description><![CDATA[将此段css放到&#60;header&#62;标签内即可 &#60;style type=&#8221;text/ &#8230; <p class="link-more"><a href="https://www.wangxuchao.cn/%e7%bd%91%e7%ab%99%e9%bb%91%e7%99%bdcss/" class="more-link">继续阅读<span class="screen-reader-text">“网站黑白css”</span></a></p>]]></description>
										<content:encoded><![CDATA[<p>将此段css放到&lt;header&gt;标签内即可</p>
<p>&lt;style type=&#8221;text/css&#8221;&gt;<br />
html{ filter: grayscale(100%); -webkit-filter: grayscale(100%); -moz-filter: grayscale(100%); -ms-filter:<br />
grayscale(100%); -o-filter: grayscale(100%); filter: url(&#8220;data:image/svg+xml;utf8,&lt;svg xmlns=\&#8217;<br />
http://www.w3.org/2000/svg\&#8217;&gt;&lt;filter id=\&#8217;grayscale\&#8217;&gt;&lt;feColorMatrix type=\&#8217;matrix\&#8217; values=\&#8217;0.3333<br />
0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0 0 0 1<br />
0\&#8217;/&gt;&lt;/filter&gt;&lt;/svg&gt;#grayscale&#8221;); filter:progid:DXImageTransform.Microsoft.BasicImage(grayscale=1); &#8211;<br />
webkit-filter: grayscale(1);}<br />
&lt;/style&gt;</p>
]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
