fix no wifi adaper found in ubuntu 18.04

This blog will focus on how to solve the problem about no wireless adapter found after we set up the Ubuntu 18.04 successfully.
First: run sudo lshw -C network at a new terminal.
it is possibly no display like written in picture patched below

*-network
description: Wireless interface
product: BCM4360 802.11ac Wireless Network Adapter
vendor: Broadcom Corporation
physical id: 0
bus info: pci@0000:03:00.0
logical name: wlan0

Second:
Open Software & Update and then to go in the Additional Drivers tab and select the propriety driver and click on Apply Changes.
在这里插入图片描述在这里插入图片描述
if the propriety driver can not apply into use successfully. Then try to follow the third step.
Third:

sudo apt-get install --reinstall make
sudo apt-get install build-essential

Please update your kernel to the lasts one.

sudo apt-get dist-upgrade

A repo for the newest Realtek rtlwifi codes.

This code will build on any kernel 4.19 and newer as long as the distro has not modified any of the kernel APIs. This repository includes drivers for the following cards:
RTL8822BE, RTL8822CE, RTL8821CE, and RTL8723DE.

Installation instruction

Requirements

You will need to install “make”, “gcc”, “kernel headers”, “kernel build essentials”, and “git”. You can install them with the following command, on Ubuntu:

sudo apt-get update
sudo apt-get install make gcc linux-headers-$(uname -r) build-essentials git

Installation

For all distros:

git clone https://github.com/lwfinger/rtlwifi_new.git -b rtw88
cd rtlwifi_new
make
sudo make install

disable/enable a Kernel module

sudo modprobe -r rtw_8723de         #This disable the module
sudo modprobe rtw_8723de            #This enables the module, you can add options like ant_sel=2

Then Wi-Fi still do not work. Try the second step again.

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
1、好的,定义一个书籍类: ``` public class Book { private String title; private int image; public Book(String title, int image) { this.title = title; this.image = image; } public String getTitle() { return title; } public int getImage() { return image; } } ``` 2、创建一个Activity: ``` public class BookListActivity extends AppCompatActivity { private RecyclerView recyclerView; private BookListAdapter adapter; private List<Book> bookList; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_book_list); recyclerView = findViewById(R.id.recyclerView); RecyclerView.LayoutManager layoutManager = new LinearLayoutManager(this); recyclerView.setLayoutManager(layoutManager); bookList = new ArrayList<>(); createBookList(); adapter = new BookListAdapter(bookList); recyclerView.setAdapter(adapter); } private void createBookList() { for (int i = 1; i <= 20; i++) { String title = "Book " + i; int image = R.drawable.book_cover; Book book = new Book(title, image); bookList.add(book); } } } ``` 3、在activity中创建一个方法来添加20本书的信息: 我在上面的代码中已经添加了该方法,名字就是createBookList(),在这个方法里面就可以创建20本书的信息。 4、定义RecyclerView每项所用的布局,布局用CardView来显示书籍信息。在res/layout目录下创建一个新的布局文件book_item.xml: ``` <?xml version="1.0" encoding="utf-8"?> <androidx.cardview.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:layout_width="match_parent" android:layout_height="wrap_content" app:cardCornerRadius="8dp" app:cardElevation="2dp" app:cardUseCompatPadding="true"> <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="horizontal"> <ImageView android:id="@+id/imageView" android:layout_width="96dp" android:layout_height="96dp" android:padding="8dp" android:src="@drawable/book_cover" android:scaleType="centerCrop"/> <TextView android:id="@+id/titleTextView" android:layout_width="0dp" android:layout_height="wrap_content" android:layout_weight="1" android:textSize="20sp" android:textStyle="bold" android:textColor="@color/black" android:padding="16dp" /> </LinearLayout> </androidx.cardview.widget.CardView> ``` 这个布局文件包含一个LinearLayout,里面有一个ImageView显示书籍的图片,一个TextView显示书籍的标题。这个布局文件中使用了CardView来把每一项(即一个书籍)进行包含,这样每个书籍的信息就看起来非常整洁漂亮。 最后,在Adaper中去实现我们定义的布局文件book_item.xml,实现代码如下: ``` public class BookListAdapter extends RecyclerView.Adapter<BookListAdapter.BookViewHolder> { private List<Book> bookList; public class BookViewHolder extends RecyclerView.ViewHolder { public TextView titleTextView; public ImageView imageView; public BookViewHolder(View view) { super(view); titleTextView = view.findViewById(R.id.titleTextView); imageView = view.findViewById(R.id.imageView); } } public BookListAdapter(List<Book> bookList) { this.bookList = bookList; } @Override public BookViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { View itemView = LayoutInflater.from(parent.getContext()) .inflate(R.layout.book_item, parent, false); return new BookViewHolder(itemView); } @Override public void onBindViewHolder(BookViewHolder holder, int position) { Book book = bookList.get(position); holder.titleTextView.setText(book.getTitle()); holder.imageView.setImageResource(book.getImage()); } @Override public int getItemCount() { return bookList.size(); } } ``` 这里使用一个ViewHolder来实现RecyclerView的重用,同时在onBindViewHolder()方法里面把每一项的信息进行展示。 以上就是实现RecyclerView展示书籍信息所需的全部代码,可以根据需求进行调整和优化。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值